Skip to content

Commit

Permalink
fix #9720: Prevent crash when importing a PDF with no staff.
Browse files Browse the repository at this point in the history
  • Loading branch information
WcRnm authored and vpereverzev committed Dec 10, 2020
1 parent 82096c0 commit 9b678aa
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion omr/importpdf.cpp
Expand Up @@ -277,7 +277,12 @@ Score::FileError importPdf(MasterScore* score, const QString& path)
OmrState state;
state.score = score;
for (OmrPage* omrPage1 : omr->pages()) {
OmrStaff staff = omrPage1->systems().last().staves().first();
if (omrPage1->systems().count() == 0)
continue;
OmrSystem system = omrPage1->systems().last();
if (system.staves().count() == 0)
continue;
OmrStaff staff = system.staves().first();
qreal top = staff.top()/omr->spatium();
state.importPdfPage(omrPage1, top);
}
Expand Down

0 comments on commit 9b678aa

Please sign in to comment.