summaryrefslogtreecommitdiff
path: root/src/fold.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/fold.c')
-rw-r--r--src/fold.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/fold.c b/src/fold.c
index 8cd51a9c2..bb7b8b7cc 100644
--- a/src/fold.c
+++ b/src/fold.c
@@ -2594,8 +2594,9 @@ foldUpdateIEMSRecurse(gap, level, startlnum, flp, getlevel, bot, topflags)
/*
* The fold includes the line "flp->lnum" and "flp->lnum_save".
+ * Check "fp" for safety.
*/
- if (lvl > level)
+ if (lvl > level && fp != NULL)
{
/*
* There is a nested fold, handle it recursively.