Add check to guard against doing an ls of a non-directory

This commit is contained in:
Gary Talent 2017-07-01 01:31:41 -05:00
parent ca7a1624b5
commit 4ae353a9b6

View File

@ -43,7 +43,9 @@ OxFSFile *OxFSFile::child(int row) {
int OxFSFile::childCount() const {
if (m_fs) {
QVector<DirectoryListing<QString>> 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;