diff options
author | Yegappan Lakshmanan <yegappan@yahoo.com> | 2024-05-01 11:44:17 +0200 |
---|---|---|
committer | Christian Brabandt <cb@256bit.org> | 2024-05-01 11:44:17 +0200 |
commit | b2e42b9be0ffa193ef32ad5a5846ef46f5cc4e8c (patch) | |
tree | cde59e471fa2fc50d6f2c7f5d4ac2fc332266e0b /src/eval.c | |
parent | ca4b81a7ae9ed524c7097dda2638cf55f2672afc (diff) |
patch 9.1.0385: Vim9: crash with null_class and null_objectv9.1.0385
Problem: Vim9: crash with null_class and null_object
(Aliaksei Budavei)
Solution: Handle null_class and null_object correctly
(Yegappan Lakshmanan)
fixes: #14678
closes: #14681
Signed-off-by: Yegappan Lakshmanan <yegappan@yahoo.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
Diffstat (limited to 'src/eval.c')
-rw-r--r-- | src/eval.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/eval.c b/src/eval.c index 51ee604319..21ba1bcfcd 100644 --- a/src/eval.c +++ b/src/eval.c @@ -6403,9 +6403,9 @@ echo_string_core( { class_T *cl = tv->vval.v_class; char *s = "class"; - if (IS_INTERFACE(cl)) + if (cl && IS_INTERFACE(cl)) s = "interface"; - else if (IS_ENUM(cl)) + else if (cl && IS_ENUM(cl)) s = "enum"; size_t len = STRLEN(s) + 1 + (cl == NULL ? 9 : STRLEN(cl->class_name)) + 1; |