Commit fd848197 authored by Daniel Wolf's avatar Daniel Wolf
Browse files

Don't null-assert value as it might not be set yet

parent c4754da6
...@@ -540,8 +540,9 @@ class DnsRuleFragment : Fragment() { ...@@ -540,8 +540,9 @@ class DnsRuleFragment : Fragment() {
private fun updateRuleCountTitle() { private fun updateRuleCountTitle() {
activity?.runOnUiThread { activity?.runOnUiThread {
(activity as AppCompatActivity?)?.supportActionBar?.subtitle = if(getPreferences().dnsRulesEnabled) { (activity as AppCompatActivity?)?.supportActionBar?.subtitle = if(getPreferences().dnsRulesEnabled) {
val formattedString = getPreferences().numberFormatter.format(totalRuleCount ?: 0) val ruleCount = totalRuleCount ?: 0
resources.getQuantityString(R.plurals.window_dnsrules_subtitle, totalRuleCount!!.toInt(), formattedString) val formattedString = getPreferences().numberFormatter.format(ruleCount)
resources.getQuantityString(R.plurals.window_dnsrules_subtitle, ruleCount.toInt(), formattedString)
} else null } else null
} }
} }
......
Supports Markdown
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