Add requirement for address to not be 0 and throw error

This commit is contained in:
pooleja
2017-07-20 10:51:57 -07:00
parent c3a30e9be3
commit b2e36314cb
2 changed files with 37 additions and 38 deletions

View File

@ -33,9 +33,8 @@ contract Ownable {
* @param newOwner The address to transfer ownership to.
*/
function transferOwnership(address newOwner) onlyOwner {
if (newOwner != address(0)) {
owner = newOwner;
}
require(newOwner != address(0));
owner = newOwner;
}
}