aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorverdant <im@verdant.ee>2026-08-03 19:35:31 +0800
committerverdant <im@verdant.ee>2026-08-03 19:40:34 +0800
commitcce383a05f2ea557fa27103ea51052b6fb35714a (patch)
treec72f44ccda2bf82e3d01a9af99ace0e1ffb0e3a6 /src
parentfee7ec9cbe60a2e5db5193a1db353ccd1fc5e5a3 (diff)
downloadsf-cce383a05f2ea557fa27103ea51052b6fb35714a.tar.gz
sf-cce383a05f2ea557fa27103ea51052b6fb35714a.zip
Fix crash when scrolling in a empty directory
Disable scrolling when it is a empty directory.
Diffstat (limited to 'src')
-rw-r--r--src/fm.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/fm.c b/src/fm.c
index 0d59ab9..38d7c83 100644
--- a/src/fm.c
+++ b/src/fm.c
@@ -318,6 +318,9 @@ fm_entries_scroll(fm_info *info, int n)
if (!info)
return;
+ if (info->cur->count == 0)
+ return;
+
info->cursor += n;
if (info->cursor < 0)