Commit 10725c39 authored by Mygod's avatar Mygod

Check QsTile is null

parent 4b5c9402
...@@ -25,6 +25,7 @@ final class ShadowsocksTileService extends TileService with ServiceBoundContext ...@@ -25,6 +25,7 @@ final class ShadowsocksTileService extends TileService with ServiceBoundContext
def trafficUpdated(txRate: Long, rxRate: Long, txTotal: Long, rxTotal: Long) = () def trafficUpdated(txRate: Long, rxRate: Long, txTotal: Long, rxTotal: Long) = ()
def stateChanged(state: Int, msg: String) { def stateChanged(state: Int, msg: String) {
val tile = getQsTile val tile = getQsTile
if (tile != null) {
state match { state match {
case State.STOPPED => case State.STOPPED =>
tile.setIcon(iconIdle) tile.setIcon(iconIdle)
...@@ -45,6 +46,7 @@ final class ShadowsocksTileService extends TileService with ServiceBoundContext ...@@ -45,6 +46,7 @@ final class ShadowsocksTileService extends TileService with ServiceBoundContext
tile.updateTile tile.updateTile
} }
} }
}
override def onServiceConnected() = callback.stateChanged(bgService.getState, null) override def onServiceConnected() = callback.stateChanged(bgService.getState, null)
......
Markdown is supported
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