0
0
mirror of https://github.com/vim/vim.git synced 2025-10-04 05:25:06 -04:00

patch 9.0.1370: crash when using a NULL object

Problem:    Crash when using a NULL object. (Ernie Rael)
Solution:   Check for NULL and give an error message. (closes #12083)
This commit is contained in:
Bram Moolenaar
2023-03-02 17:38:33 +00:00
parent c6ff21e876
commit c3f971f289
3 changed files with 27 additions and 0 deletions

View File

@@ -235,6 +235,24 @@ def Test_object_not_set()
END
v9.CheckScriptFailure(lines, 'E1360:')
lines =<< trim END
vim9script
class Class
this.id: string
def Method1()
echo 'Method1' .. this.id
enddef
endclass
var obj: Class
def Func()
obj.Method1()
enddef
Func()
END
v9.CheckScriptFailure(lines, 'E1360:')
lines =<< trim END
vim9script