Null values are always allowed

This commit is contained in:
2022-08-22 18:26:05 +01:00
parent 5b82ed8e45
commit ebe1d712c9

View File

@@ -33,6 +33,11 @@ static bool checkType(Literal typeLiteral, Literal value) {
return false; return false;
} }
//always allow null values
if (IS_NULL(value)) {
return true;
}
//for each type, if a mismatch is found, return false //for each type, if a mismatch is found, return false
if (AS_TYPE(typeLiteral).typeOf == LITERAL_BOOLEAN && !IS_BOOLEAN(value)) { if (AS_TYPE(typeLiteral).typeOf == LITERAL_BOOLEAN && !IS_BOOLEAN(value)) {
return false; return false;