Skip to content

Commit 183c79a

Browse files
committed
check argument in delete dialog
1 parent 5c7aba8 commit 183c79a

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

app/src/main/kotlin/org/emunix/insteadlauncher/ui/dialogs/DeleteGameDialog.kt

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2019-2020 Boris Timofeev <btimofeev@emunix.org>
2+
* Copyright (c) 2019-2021 Boris Timofeev <btimofeev@emunix.org>
33
* Distributed under the MIT License (license terms are at http://opensource.org/licenses/MIT).
44
*/
55

@@ -26,11 +26,12 @@ class DeleteGameDialog : DialogFragment() {
2626

2727
override fun onCreateDialog(savedInstanceState: Bundle?): Dialog {
2828
val game = requireArguments().getString("game")
29+
require(game != null)
2930
return MaterialAlertDialogBuilder(requireContext(), R.style.AppTheme_AlertDialogOverlay)
3031
.setTitle(R.string.dialog_delete_game_title)
3132
.setMessage(R.string.dialog_delete_game_text)
3233
.setPositiveButton(R.string.dialog_delete_game_positive_button) { _, _ ->
33-
DeleteGame.start(requireContext().applicationContext, game!!)
34+
DeleteGame.start(requireContext().applicationContext, game)
3435
}
3536
.setNegativeButton(R.string.dialog_delete_game_negative_button) { dialog, _ ->
3637
dialog.cancel()

0 commit comments

Comments
 (0)