patch 9.0.1320: checking the type of a null object causes a crash
Problem: Checking the type of a null object causes a crash.
Solution: Don't try to get the class of a null object. (closes #12005)
Handle error from calling a user function better.
diff --git a/src/evalfunc.c b/src/evalfunc.c
index 08f8847..7f6cbac 100644
--- a/src/evalfunc.c
+++ b/src/evalfunc.c
@@ -3056,8 +3056,8 @@
int
check_internal_func(int idx, int argcount)
{
- int res;
- char *name;
+ funcerror_T res;
+ char *name;
if (argcount < global_functions[idx].f_min_argc)
res = FCERR_TOOFEW;
@@ -3074,7 +3074,7 @@
return -1;
}
- int
+ funcerror_T
call_internal_func(
char_u *name,
int argcount,
@@ -3107,7 +3107,7 @@
/*
* Invoke a method for base->method().
*/
- int
+ funcerror_T
call_internal_method(
char_u *name,
int argcount,