This PR fixes a possible crash which can be reproduced with the following steps:
Start OpenBoard.
Go to document mode and open a document with a small number of pages, let's say only one.
Again go to document mode and open a document with more pages.
In this document, go to a page with a higher number than the first document's page count.
Open the favorites in the library palette. You see the opened documents.
Drag the first document to the board. everything is ok.
Drag the second document to the board. OpenBoard crashes.
The reason is that when dragging the second document and switching to the selected page of that document the thumbnail update is triggered, even if the thumbnails for that document have not been created.
This PR is very simple and just fixes the range check.
fix crash by out-of-range index when updating thumbnails
This PR fixes a possible crash which can be reproduced with the following steps:
The reason is that when dragging the second document and switching to the selected page of that document the thumbnail update is triggered, even if the thumbnails for that document have not been created.
This PR is very simple and just fixes the range check.