Ensure studio_bundle_to_use is not None before accessing is_dev a…#292
Merged
iLLiCiTiT merged 2 commits intoynput:developfrom Mar 6, 2026
Merged
Ensure studio_bundle_to_use is not None before accessing is_dev a…#292iLLiCiTiT merged 2 commits intoynput:developfrom
studio_bundle_to_use is not None before accessing is_dev a…#292iLLiCiTiT merged 2 commits intoynput:developfrom
Conversation
…nd crashing the app. Now warning message properly displays.
Contributor
There was a problem hiding this comment.
Pull request overview
Prevents an AttributeError crash in the distribution bundle-selection flow when the server returns no studio bundle (e.g., fresh server with no bundles), by guarding access to is_dev on studio_bundle_to_use.
Changes:
- Cache
studio_bundle_to_usein a local variable insideproject_bundle_to_use. - Add a
Noneguard before accessingstudio_bundle.is_dev.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+1771
to
+1773
| studio_bundle = self.studio_bundle_to_use | ||
| if studio_bundle and studio_bundle.is_dev: | ||
| self._project_bundle = studio_bundle |
There was a problem hiding this comment.
Add a regression test to cover the crash scenario this change fixes (when studio_bundle_to_use resolves to None, e.g. empty bundles list on a fresh server). Without a test, it’s easy to reintroduce an AttributeError by accessing is_dev on None again.
iLLiCiTiT
reviewed
Mar 6, 2026
Co-authored-by: Jakub Trllo <43494761+iLLiCiTiT@users.noreply.github.com>
iLLiCiTiT
approved these changes
Mar 6, 2026
Member
|
Thanks! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Ensure
studio_bundle_to_useis not None before accessingis_devand crashing the app. Now warning message properly displays.Changelog Description
Small change but if studio_bundle is not initialized & were in dev mode or even not well get a crash.
Additional info
Its 2 line of code... my 1st PR wop wop!
Testing notes: