Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Add stage initialization check in _onResize #4301

Merged
merged 1 commit into from
Jan 24, 2025

Conversation

BeNikk
Copy link
Contributor

@BeNikk BeNikk commented Jan 22, 2025

Description

fixes #4300
This PR adds a defensive check in the _onResize method to ensure this.stage is properly initialized before executing resize operations. This prevents potential errors during the application's initialization phase.

Changes Made

  • Added initialization check at the start of _onResize method
  • Added early return if stage is not initialized
  • Maintains existing resize functionality when stage is ready

Before

The _onResize method would attempt to access this.stage properties before initialization was complete.

After

Method is only called when the stage is available

Testing Done

  • Verified application loads without errors
  • Confirmed resize functionality works as expected after initialization
  • Tested resize behavior across different browsers

@BeNikk
Copy link
Contributor Author

BeNikk commented Jan 24, 2025

@walterbender Could you please take a look, and let me know if any changes are needed

@walterbender walterbender merged commit 42b8dcb into sugarlabs:master Jan 24, 2025
4 checks passed
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.

_onResize method called before stage initialization
2 participants