Skip to content

Commit

Permalink
Handle race conditions in testConnection
Browse files Browse the repository at this point in the history
  • Loading branch information
Mygod committed Mar 8, 2019
1 parent 17f16de commit 3e5ef4c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion core/src/main/java/com/github/shadowsocks/net/HttpsTest.kt
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ class HttpsTest : ViewModel() {
fun testConnection() {
cancelTest()
status.value = Status.Testing
val url = URL("https", when (Core.currentProfile!!.first.route) {
val url = URL("https", when ((Core.currentProfile ?: return).first.route) {
Acl.CHINALIST -> "www.qualcomm.cn"
else -> "www.google.com"
}, "/generate_204")
Expand Down

0 comments on commit 3e5ef4c

Please sign in to comment.