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 {
|
int OxFSFile::childCount() const {
|
||||||
if (m_fs) {
|
if (m_fs) {
|
||||||
QVector<DirectoryListing<QString>> ls;
|
QVector<DirectoryListing<QString>> ls;
|
||||||
|
if (m_fs->stat((const char*) m_path.toUtf8()).fileType == FileType_Directory) {
|
||||||
m_fs->ls(m_path.toUtf8(), &ls);
|
m_fs->ls(m_path.toUtf8(), &ls);
|
||||||
|
}
|
||||||
return ls.size();
|
return ls.size();
|
||||||
} else {
|
} else {
|
||||||
return 0;
|
return 0;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user