patch 9.0.1911: Vim9: segfault with null object and instanceof()
Problem: Vim9: segfault with null object and instanceof()
Solution: return early
closes: #13121
Signed-off-by: Christian Brabandt <cb@256bit.org>
Co-authored-by: Ernie Rael <errael@raelity.com>
diff --git a/src/vim9class.c b/src/vim9class.c
index da862f2..f122f90 100644
--- a/src/vim9class.c
+++ b/src/vim9class.c
@@ -2865,6 +2865,9 @@
|| check_for_class_or_list_arg(argvars, 1) == FAIL)
return;
+ if (object_tv->vval.v_object == NULL)
+ return;
+
if (classinfo_tv->v_type == VAR_LIST)
{
FOR_ALL_LIST_ITEMS(classinfo_tv->vval.v_list, li)