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
Imre Kristoffer Eilertsen
Nebulo
Commits
824bc87a
Commit
824bc87a
authored
Jun 03, 2021
by
Daniel Wolf
Browse files
Fix app crashing when input/output streams were not created at all
parent
1068ddb5
Changes
1
Hide whitespace changes
Inline
Side-by-side
app/src/main/java/com/frostnerd/smokescreen/util/speedtest/DnsSpeedTest.kt
View file @
824bc87a
...
...
@@ -245,12 +245,17 @@ class DnsSpeedTest(context:Context,
return
null
}
}
catch
(
ex
:
Throwable
)
{
log
(
"Request to failed: $ex"
)
return
null
}
finally
{
connection
?.
disconnect
()
if
(
wasEstablished
)
{
connection
?.
inputStream
?.
closeSilently
()
connection
?.
outputStream
?.
closeSilently
()
try
{
connection
?.
inputStream
?.
closeSilently
()
connection
?.
outputStream
?.
closeSilently
()
}
catch
(
ex
:
java
.
lang
.
Exception
)
{
log
(
"Could not close streams of failed request: $ex"
)
}
}
}
}
...
...
Write
Preview
Markdown
is supported
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