refactor(coverity/345582): assert fp is non-NULL

Since we already have a typval, we know the lookup will succeed.
This commit is contained in:
James McCoy
2022-01-19 21:42:10 -05:00
parent 431915fe6a
commit 0c541ab1f6

View File

@@ -233,6 +233,7 @@ Object vim_to_object(typval_T *obj)
{ {
if (obj->v_type == VAR_FUNC) { if (obj->v_type == VAR_FUNC) {
ufunc_T *fp = find_func(obj->vval.v_string); ufunc_T *fp = find_func(obj->vval.v_string);
assert(fp != NULL);
if (fp->uf_cb == nlua_CFunction_func_call) { if (fp->uf_cb == nlua_CFunction_func_call) {
LuaRef ref = api_new_luaref(((LuaCFunctionState *)fp->uf_cb_state)->lua_callable.func_ref); LuaRef ref = api_new_luaref(((LuaCFunctionState *)fp->uf_cb_state)->lua_callable.func_ref);
return LUAREF_OBJ(ref); return LUAREF_OBJ(ref);