fix: fix crash when onDenied runnable is null on dialogs

This commit is contained in:
LucasGGamerM 2023-06-10 18:15:25 -03:00
parent 4e21b60087
commit 72fdff96c8
1 changed files with 4 additions and 1 deletions

View File

@ -400,7 +400,10 @@ public class UiUtils {
.setTitle(title)
.setMessage(message)
.setPositiveButton(confirmButton, (dlg, i)->onConfirmed.run())
.setNegativeButton(R.string.cancel, (dialog, which) -> onDenied.run())
.setNegativeButton(R.string.cancel, (dialog, which) -> {
if (onDenied != null)
onDenied.run();
})
.setIcon(icon)
.show();
}