fix #303585 added return from restore session if failed read score #5916
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Resolves: https://musescore.org/en/node/303585
Problem: trying to get a view that is not exists and assert is triggered.
this happens when restoring a session if there is no score file
1 - Here should be added a view with score, but not added, because score is missing.
2 - Here get a view that does not exist
Fix: Added return from
restoreSession
if no scoreProblem2: The procedure for opening the last file is done in 2 places -
restoreSession
andloadScores
.Therefore, if the session cannot be restored, then there will be another attempt to open the last file, and the user will be shown a second time a message stating that the file is missing (the first message was shown in
restoreSession
)I don’t know why the opening of the last file was implemented in two places ... maybe for backward compatibility when the session functionality was introduced.
In order not to show the second message, if the file could not be read in
restoreSession
, thentrue
is returned