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

Check late property is isInitialized #5503

Merged
merged 1 commit into from
Jan 21, 2025

Conversation

aitorvs
Copy link
Collaborator

@aitorvs aitorvs commented Jan 21, 2025

Task/Issue URL: https://app.asana.com/0/1202552961248957/1209201227256746/f

Description

Ensure late property is init before using it

Steps to test this PR

NA, just code review

Copy link
Collaborator Author

aitorvs commented Jan 21, 2025

This stack of pull requests is managed by Graphite. Learn more about stacking.

@aitorvs aitorvs force-pushed the fix/aitor/launchVoiceSearch-crash branch from 12b4c61 to 7abcc09 Compare January 21, 2025 13:38
@@ -130,9 +130,10 @@ class RealVoiceSearchActivityLauncher @Inject constructor(
activity.window?.decorView?.rootView?.let {
blurRenderer.addBlur(it)
}
val stringSource = if (this::_source.isInitialized) _source.paramValueName else ""
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I honestly think we should just not make this variable lateinit anymore. We should just make it Nullable.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don’t remember much why I set this to lateinit before, but looking now, nothing is enforcing the order of the method calls, so we shouldn’t use lateinit

Copy link
Collaborator Author

@aitorvs aitorvs Jan 21, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

moved it to be a nullable var

@aitorvs aitorvs force-pushed the fix/aitor/launchVoiceSearch-crash branch from 7abcc09 to fe9b208 Compare January 21, 2025 15:24
Copy link
Contributor

@karlenDimla karlenDimla left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for fixing!!

@aitorvs aitorvs merged commit e49e92b into develop Jan 21, 2025
8 checks passed
@aitorvs aitorvs deleted the fix/aitor/launchVoiceSearch-crash branch January 21, 2025 16:08
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.

2 participants