fix Error: 'Null' is not a subtype of type 'bool'