Skip to content

Commit

Permalink
Check late property is isInitialized (#5503)
Browse files Browse the repository at this point in the history
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
  • Loading branch information
aitorvs authored Jan 21, 2025
1 parent 3a4cbd3 commit e49e92b
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ class RealVoiceSearchActivityLauncher @Inject constructor(
private const val SUGGEST_REMOVE_VOICE_SEARCH_AFTER_TIMES = 3
}

private lateinit var _source: Source
private var _source: Source? = null

override fun registerResultsCallback(
caller: ActivityResultCaller,
Expand All @@ -78,7 +78,7 @@ class RealVoiceSearchActivityLauncher @Inject constructor(
if (data.isNotEmpty()) {
pixel.fire(
pixel = VoiceSearchPixelNames.VOICE_SEARCH_DONE,
parameters = mapOf(KEY_PARAM_SOURCE to _source.paramValueName),
parameters = mapOf(KEY_PARAM_SOURCE to _source?.paramValueName.orEmpty()),
)
voiceSearchRepository.resetVoiceSearchDismissed()
onEvent(Event.VoiceRecognitionSuccess(data))
Expand Down Expand Up @@ -132,7 +132,7 @@ class RealVoiceSearchActivityLauncher @Inject constructor(
}
pixel.fire(
pixel = VoiceSearchPixelNames.VOICE_SEARCH_STARTED,
parameters = mapOf(KEY_PARAM_SOURCE to _source.paramValueName),
parameters = mapOf(KEY_PARAM_SOURCE to _source?.paramValueName.orEmpty()),
)
activityResultLauncherWrapper.launch(LaunchVoiceSearch)
}
Expand Down

0 comments on commit e49e92b

Please sign in to comment.