From 4ae353a9b64e9510f781d5ae58e30cdb5bb4add5 Mon Sep 17 00:00:00 2001 From: Gary Talent Date: Sat, 1 Jul 2017 01:31:41 -0500 Subject: [PATCH] Add check to guard against doing an ls of a non-directory --- src/nostalgia/studio/lib/oxfstreeview.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/nostalgia/studio/lib/oxfstreeview.cpp b/src/nostalgia/studio/lib/oxfstreeview.cpp index 6c4691d4..b2fe3f37 100644 --- a/src/nostalgia/studio/lib/oxfstreeview.cpp +++ b/src/nostalgia/studio/lib/oxfstreeview.cpp @@ -43,7 +43,9 @@ OxFSFile *OxFSFile::child(int row) { int OxFSFile::childCount() const { if (m_fs) { QVector> ls; - m_fs->ls(m_path.toUtf8(), &ls); + if (m_fs->stat((const char*) m_path.toUtf8()).fileType == FileType_Directory) { + m_fs->ls(m_path.toUtf8(), &ls); + } return ls.size(); } else { return 0;