Skip to content

Conversation

Yasir-Rafique
Copy link

✨ Pull Request

📓 Referenced Issue

Fixes: #1380

ℹ️ About the PR

This PR adds a defensive check before triggering a reload action in the Electron menu handler to prevent a crash when the window or its webContents are already destroyed.

  • This bug mainly affects macOS (Command+R / View > Reload), where the user could receive a TypeError: Object has been destroyed error if the reload shortcut/menu is used in certain states.

  • The fix checks mainWindow and mainWindow.webContents for existence and not being destroyed before calling .reload() or sending the reload event.

  • This follows best practices for Electron apps, and keeps behavior unchanged for unaffected platforms (e.g., Windows).

🖼️ Testing Scenarios / Screenshots

  • On Windows, Ctrl+R and View > Reload continue to work as expected, and no errors are thrown.

  • While the original crash was reported on macOS, this change should prevent the uncaught exception for all platforms.

  • Please confirm on macOS that the bug is resolved.

@CLAassistant
Copy link

CLAassistant commented Jul 14, 2025

CLA assistant check
All committers have signed the CLA.

@Yasir-Rafique
Copy link
Author

Hello @karbassi @jeffbowen @Grafikart

Texting here just for the follow up. This PR is in inline for more than a month. Could you please review it and merge it accordingly. Would really appreciate that. Thanks!

@Yasir-Rafique
Copy link
Author

Thanks @Grafikart for approving these changes. Really appreciate that.
Looking forward for the approval of others @karbassi @jeffbowen.

@Yasir-Rafique
Copy link
Author

Hello @karbassi @jeffbowen
Just a follow-up on this PR as it got approved by @Grafikart.
Looking forward for your approvals & get this PR merged.
thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Issue with reloading pages

3 participants