mirror of
https://github.com/qelectrotech/qelectrotech-source-mirror.git
synced 2026-09-20 15:24:14 +02:00
Fix: avoid crash when opening a project without a folio (diagram).
This commit is contained in:
@@ -210,10 +210,14 @@ void ProjectView::changeFirstTab()
|
||||
}
|
||||
|
||||
/**
|
||||
@return first folio of current project
|
||||
@return first folio of current project, or nullptr if the project
|
||||
has no diagram.
|
||||
*/
|
||||
DiagramView *ProjectView::firstDiagram()
|
||||
{
|
||||
if (m_diagram_ids.isEmpty()) {
|
||||
return(nullptr);
|
||||
}
|
||||
return(m_diagram_ids.first());
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user