Skip to content

Commit ddb5b4a

Browse files
Mygodkaneawk
authored andcommitted
Fix NullPointerException caused by delay
1 parent 9ff6090 commit ddb5b4a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/main/scala/com/github/shadowsocks/BaseService.scala

+1-1
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ trait BaseService extends Service {
7575

7676
if (isConnected && profile.kcp && kcptunProcess != null) {
7777
restartHanlder.removeCallbacks(null)
78-
restartHanlder.postDelayed(() => kcptunProcess.restart(), 2000)
78+
restartHanlder.postDelayed(() => if (kcptunProcess != null) kcptunProcess.restart(), 2000)
7979
}
8080
}
8181
var networkReceiverRegistered: Boolean = _

0 commit comments

Comments
 (0)