summaryrefslogtreecommitdiff
path: root/src/option.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/option.c')
-rw-r--r--src/option.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/option.c b/src/option.c
index ebc547e73..cdb0d67e6 100644
--- a/src/option.c
+++ b/src/option.c
@@ -7570,6 +7570,9 @@ did_set_string_option(
did_filetype = TRUE;
apply_autocmds(EVENT_FILETYPE, curbuf->b_p_ft,
curbuf->b_fname, TRUE, curbuf);
+ /* Just in case the old "curbuf" is now invalid. */
+ if (varp != &(curbuf->b_p_ft))
+ varp = NULL;
}
}
#endif