Fix crash when CMS dies and user returns to app view activity and taps a game

This commit is contained in:
Cameron Gutman
2018-10-30 20:21:11 -07:00
parent a7e65b47f9
commit 977215a098
2 changed files with 9 additions and 2 deletions

View File

@@ -37,6 +37,11 @@ public class ServerHelper {
public static void doStart(Activity parent, NvApp app, ComputerDetails computer,
ComputerManagerService.ComputerManagerBinder managerBinder) {
if (computer.state == ComputerDetails.State.OFFLINE ||
ServerHelper.getCurrentAddressFromComputer(computer) == null) {
Toast.makeText(parent, parent.getResources().getString(R.string.pair_pc_offline), Toast.LENGTH_SHORT).show();
return;
}
parent.startActivity(createStartIntent(parent, app, computer, managerBinder));
}