Add check to guard against doing an ls of a non-directory
This commit is contained in:
parent
ca7a1624b5
commit
4ae353a9b6
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user