mirror of
https://github.com/vim/vim.git
synced 2025-09-25 03:54:15 -04:00
patch 8.2.1924: Vim9: crash when indexing dict with NULL key
Problem: Vim9: crash when indexing dict with NULL key. Solution: Use empty string instead of NULL. (closes #7229) Make error message more useful for empty string.
This commit is contained in:
@@ -2607,6 +2607,8 @@ call_def_function(
|
||||
tv = STACK_TV_BOT(-1);
|
||||
// no need to check for VAR_STRING, 2STRING will check.
|
||||
key = tv->vval.v_string;
|
||||
if (key == NULL)
|
||||
key = (char_u *)"";
|
||||
|
||||
if ((di = dict_find(dict, key, -1)) == NULL)
|
||||
{
|
||||
|
Reference in New Issue
Block a user