I want to make sure that when doSomething()
is called, the string variable is always populated (that it can't be left blank):
function doSomething (string hash) public {
require(hash != null);
}
Similarly, I want to make sure that when doSomethingElse()
is called, the string is not already mapped to an address:
mapping (string => address) public hashes;
function doSomethingElse (string hash) public {
require(hashes[hash] = null);
}
I know null
is not the correct syntax, but what is?