patch 9.1.0387: Vim9: null value tests not sufficient
Problem: Vim9: null value tests not sufficient
Solution: Add a more comprehensive test for null values
(Yegappan Lakshmanan)
closes: #14701
Signed-off-by: Yegappan Lakshmanan <yegappan@yahoo.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
diff --git a/src/eval.c b/src/eval.c
index 21ba1bc..a91ca2d 100644
--- a/src/eval.c
+++ b/src/eval.c
@@ -6403,9 +6403,9 @@
{
class_T *cl = tv->vval.v_class;
char *s = "class";
- if (cl && IS_INTERFACE(cl))
+ if (cl != NULL && IS_INTERFACE(cl))
s = "interface";
- else if (cl && IS_ENUM(cl))
+ else if (cl != NULL && IS_ENUM(cl))
s = "enum";
size_t len = STRLEN(s) + 1 +
(cl == NULL ? 9 : STRLEN(cl->class_name)) + 1;