Commit d467ce27 authored by Mygod's avatar Mygod

Safe calls when checking state

parent 9620f209
...@@ -361,7 +361,7 @@ class CustomRulesFragment : ToolbarFragment(), Toolbar.OnMenuItemClickListener, ...@@ -361,7 +361,7 @@ class CustomRulesFragment : ToolbarFragment(), Toolbar.OnMenuItemClickListener,
} }
} }
private val isEnabled get() = (activity as MainActivity).state == BaseService.State.Stopped || private val isEnabled get() = (activity as? MainActivity)?.state == BaseService.State.Stopped ||
Core.currentProfile?.first?.route != Acl.CUSTOM_RULES Core.currentProfile?.first?.route != Acl.CUSTOM_RULES
private val selectedItems = HashSet<Any>() private val selectedItems = HashSet<Any>()
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment