fetchurl: Correctly handle { outputHash != ""; outputHashAlgo = "" }

Previously, the error that would be thrown would have been confusing:
```
fetchurl requires a hash for fixed-output derivation
```

nicoo af5682b3 a59f0307

+3 -1
+3 -1
pkgs/build-support/fetchurl/default.nix
··· 124 124 then throw "multiple hashes passed to fetchurl" else 125 125 126 126 if hash != "" then { outputHashAlgo = null; outputHash = hash; } 127 - else if (outputHash != "" && outputHashAlgo != "") then { inherit outputHashAlgo outputHash; } 127 + else if outputHash != "" then 128 + if outputHashAlgo != "" then { inherit outputHashAlgo outputHash; } 129 + else throw "fetchurl was passed outputHash without outputHashAlgo" 128 130 else if sha512 != "" then { outputHashAlgo = "sha512"; outputHash = sha512; } 129 131 else if sha256 != "" then { outputHashAlgo = "sha256"; outputHash = sha256; } 130 132 else if sha1 != "" then { outputHashAlgo = "sha1"; outputHash = sha1; }