From eba9148924eaeaad3d83542e5177f11d4602a53a Mon Sep 17 00:00:00 2001 From: joshua Date: Fri, 27 Sep 2019 19:25:38 +0200 Subject: [PATCH] Fix crash when a .qet file with 0 diagrams. --- sources/projectview.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/sources/projectview.cpp b/sources/projectview.cpp index af4384b4b..a750dab42 100644 --- a/sources/projectview.cpp +++ b/sources/projectview.cpp @@ -882,11 +882,14 @@ void ProjectView::loadDiagrams() addDiagram(sv); } - this->currentDiagram()->diagram()->loadElmtFolioSeq(); - this->currentDiagram()->diagram()->loadCndFolioSeq(); + if (DiagramView *dv = currentDiagram()) + { + dv->diagram()->loadElmtFolioSeq(); + dv->diagram()->loadCndFolioSeq(); + } QSettings settings; - // If project have the folios list, move it at the beginning of the project + // If project have the folios list, move it at the beginning of the project if (m_project -> getFolioSheetsQuantity()) { for (int i = 0; i < m_project->getFolioSheetsQuantity(); i++) m_tab -> tabBar() -> moveTab(diagram_views().size()-1, + (settings.value("projectview/foliolist_position").toInt() -1));