OpenBoard-org / OpenBoard

OpenBoard is a cross-platform interactive whiteboard application intended for use in a classroom setting.
https://openboard.ch/
GNU General Public License v3.0
2.4k stars 429 forks source link

fix: index range check for thumbnails #1088

Closed letsfindaway closed 2 months ago

letsfindaway commented 2 months ago

This PR fixes a possible crash which can be reproduced with the following steps:

  1. Start OpenBoard.
  2. Go to document mode and open a document with a small number of pages, let's say only one.
  3. Again go to document mode and open a document with more pages.
  4. In this document, go to a page with a higher number than the first document's page count.
  5. Open the favorites in the library palette. You see the opened documents.
  6. Drag the first document to the board. everything is ok.
  7. 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.