summaryrefslogtreecommitdiff
path: root/src/vim9script.c
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2022-04-24 21:33:20 +0100
committerBram Moolenaar <Bram@vim.org>2022-04-24 21:33:20 +0100
commitaac12daa61d9e84616771ec9242fd232f46786e6 (patch)
tree565662e4cac5fd719c5ef61ac483574c8ab163a8 /src/vim9script.c
parent659c240cf769925ff432b88df8719e7ace4629b0 (diff)
downloadvim-git-aac12daa61d9e84616771ec9242fd232f46786e6.tar.gz
patch 8.2.4821: crash when imported autoload script was deletedv8.2.4821
Problem: Crash when imported autoload script was deleted. Solution: Initialize local variable. (closes #10274) Give a more meaningful error message.
Diffstat (limited to 'src/vim9script.c')
-rw-r--r--src/vim9script.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/vim9script.c b/src/vim9script.c
index 4f0190e41..bb5f0299d 100644
--- a/src/vim9script.c
+++ b/src/vim9script.c
@@ -713,7 +713,10 @@ find_exported(
if (script->sn_import_autoload && script->sn_state == SN_STATE_NOT_LOADED)
{
if (do_source(script->sn_name, FALSE, DOSO_NONE, NULL) == FAIL)
+ {
+ semsg(_(e_cant_open_file_str), script->sn_name);
return -1;
+ }
}
// Find name in "script".