Skip to content

Commit

Permalink
remove requireNotNull
Browse files Browse the repository at this point in the history
  • Loading branch information
anandwana001 committed Dec 17, 2024
1 parent a8cbc36 commit d2586a3
Showing 1 changed file with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,12 @@ class OfflineAreaViewerFragment @Inject constructor() : AbstractMapContainerFrag
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)

// TODO(#2649) requireNotNull will throw error, it should be handle smoothly
val args = OfflineAreaViewerFragmentArgs.fromBundle(requireNotNull(arguments))
val args =
arguments?.let { OfflineAreaViewerFragmentArgs.fromBundle(it) }
?: run {
findNavController().navigateUp()
return

Check warning on line 47 in ground/src/main/java/com/google/android/ground/ui/offlineareas/viewer/OfflineAreaViewerFragment.kt

View check run for this annotation

Codecov / codecov/patch

ground/src/main/java/com/google/android/ground/ui/offlineareas/viewer/OfflineAreaViewerFragment.kt#L45-L47

Added lines #L45 - L47 were not covered by tests
}
viewModel = getViewModel(OfflineAreaViewerViewModel::class.java)
viewModel.initialize(args.offlineAreaId)
}
Expand Down

0 comments on commit d2586a3

Please sign in to comment.