Null ptr check in value assignment