Skip to content

fix: Add stage initialization check in _onResize#4301

Merged
walterbender merged 1 commit intosugarlabs:masterfrom
BeNikk:fix/stage-init-resize
Jan 24, 2025
Merged

fix: Add stage initialization check in _onResize#4301
walterbender merged 1 commit intosugarlabs:masterfrom
BeNikk:fix/stage-init-resize

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