Skip to content

OpenToonz - An open-source full-featured 2D animation creation software

C

fix #1156 which causes program to crash when expanding history

Adham Zahran733fe44a2a3b
diff --git a/toonz/sources/toonz/dvdirtreeview.cpp b/toonz/sources/toonz/dvdirtreeview.cpp
index b76b75270..71f739dd5 100644
--- a/toonz/sources/toonz/dvdirtreeview.cpp
+++ b/toonz/sources/toonz/dvdirtreeview.cpp
@@ -1631,7 +1631,7 @@ void DvDirTreeView::getExpandedPathsRecursive(const QModelIndex &index,
void DvDirTreeView::onExpanded(const QModelIndex &index) {
QStringList paths;
getExpandedPathsRecursive(index, paths);
- paths.removeFirst();
+ if (paths.size()) paths.removeFirst();
MyFileSystemWatcher::instance()->addPaths(paths);
}