fix(typval): don't treat v:null as truthy (#23281)

This commit is contained in:
zeertzjq
2023-04-23 17:44:08 +08:00
committed by GitHub
parent 3ac952d4e2
commit 1355861b92
2 changed files with 7 additions and 1 deletions

View File

@@ -4224,7 +4224,7 @@ bool tv2bool(const typval_T *const tv)
case VAR_BOOL:
return tv->vval.v_bool == kBoolVarTrue;
case VAR_SPECIAL:
return tv->vval.v_special == kSpecialVarNull;
return tv->vval.v_special != kSpecialVarNull;
case VAR_BLOB:
return tv->vval.v_blob != NULL && tv->vval.v_blob->bv_ga.ga_len > 0;
case VAR_UNKNOWN: