mirror of
https://github.com/SimpleMobileTools/Simple-Calendar.git
synced 2025-06-05 21:59:17 +02:00
check if mEvent was initialized before working with it
This commit is contained in:
@@ -245,6 +245,10 @@ class EventActivity : SimpleActivity() {
|
||||
|
||||
private fun setupOptionsMenu() {
|
||||
event_toolbar.setOnMenuItemClickListener { menuItem ->
|
||||
if (!::mEvent.isInitialized) {
|
||||
return@setOnMenuItemClickListener true
|
||||
}
|
||||
|
||||
when (menuItem.itemId) {
|
||||
R.id.save -> saveCurrentEvent()
|
||||
R.id.delete -> deleteEvent()
|
||||
|
Reference in New Issue
Block a user