Skip to content

Commit

Permalink
Remove nullability
Browse files Browse the repository at this point in the history
  • Loading branch information
miloszwasacz committed Mar 24, 2020
1 parent 32d7c75 commit f1ebbfc
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,13 @@ class InterpretationTask(private val viewModel: CommunicationViewModel, private
when(resultPacket) {
//Odbieranie planszy
is PacketSTT -> {
if(viewModel.createBoardState(resultPacket) == null) {
val result = viewModel.createBoardState(resultPacket)
if(result == null) {
viewModel.debugMsg.value = Event(PacketBadErrDbgUin(method = "ERR", params = ParamsBadErrDbgUin(viewModel.getApplication<Application>().getString(R.string.warning_invalid_stt)), time = resultPacket.time))
}
else {
viewModel.connectDialog.value = Event(false)
viewModel.currentGameState.value = Event(viewModel.createBoardState(resultPacket))
viewModel.currentGameState.value = Event(result)
}
Log.i("packetSTT", resultPacket.toString())
}
Expand Down

0 comments on commit f1ebbfc

Please sign in to comment.