mirror of https://github.com/AMT-Cheif/drift.git
Prevent additional checks from failing if nullable value is null
This commit is contained in:
parent
d9f342a180
commit
9bb85dfe46
|
@ -190,10 +190,11 @@ class GeneratedColumn<T extends Object> extends Column<T> {
|
|||
final nullOk = $nullable;
|
||||
if (!nullOk && value == null) {
|
||||
return _invalidNull;
|
||||
} else if (nullOk && value == null) {
|
||||
return const VerificationResult.success();
|
||||
} else {
|
||||
// ignore: null_check_on_nullable_type_parameter
|
||||
return additionalChecks?.call(value!, meta) ??
|
||||
const VerificationResult.success();
|
||||
// ignore: null_check_on_nullable_type_parameter
|
||||
return additionalChecks?.call(value!, meta) ?? const VerificationResult.success();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue