Fix crash when calculating Asar file content offsets #711
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.
Fixes #704, #637, #646
Some Electron apps such as Mattermost Desktop 5.0.0 contain a directory named "offset" in their app.asar files, which is treated in code as a
dict
ofdict
s representing files and subdirectories. Hardcode Tray expects a string for actual offset values before recalculating them. This fix adds a check to make sure that it only performs the said action on offset numbers.However, another bug came up as I completed this. For some reason, Hardcode Tray could no longer find unread and mentioned tray icons for Mattermost Desktop 5.0.0, leaving them intact as a result. This PR is complete once I have a fix for that side effect pushed into this PR and no further side effects appear.Edit: The side effect was rather caused by typos in the proposed changes to
mattermost.electron.json
. Details are found in my comment on the mentioned issue.