Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Nathan OBrian
Nebulo
Commits
fd848197
Commit
fd848197
authored
Jan 24, 2021
by
Daniel Wolf
Browse files
Don't null-assert value as it might not be set yet
parent
c4754da6
Changes
1
Hide whitespace changes
Inline
Side-by-side
app/src/main/java/com/frostnerd/smokescreen/fragment/DnsRuleFragment.kt
View file @
fd848197
...
@@ -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
}
}
}
}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment