byucs340ta / Winter2019

2 stars 0 forks source link

Team 24: Clicking the destination card deck when empty crashes the game #334

Open ZachClayburn opened 5 years ago

ZachClayburn commented 5 years ago

When all of the destination cards have been drawn, If a player attempts to draw more, they are booted to the game selection menu. This is accompanied by the following error: E/AndroidRuntime: FATAL EXCEPTION: main Process: com.example.rholbrook.tickettoride, PID: 3497 java.lang.NullPointerException: Attempt to invoke virtual method 'int com.example.shared.model.Ticket.getTicketId()' on a null object reference at com.example.rholbrook.tickettoride.game.SelectTicketsDialogFragment.onCreateDialog(SelectTicketsDialogFragment.java:90) at android.support.v4.app.DialogFragment.onGetLayoutInflater(DialogFragment.java:330) at android.support.v4.app.Fragment.performGetLayoutInflater(Fragment.java:1308) at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:1460) at android.support.v4.app.FragmentManagerImpl.moveFragmentToExpectedState(FragmentManager.java:1784) at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:1852) at android.support.v4.app.BackStackRecord.executeOps(BackStackRecord.java:802) at android.support.v4.app.FragmentManagerImpl.executeOps(FragmentManager.java:2625) at android.support.v4.app.FragmentManagerImpl.executeOpsTogether(FragmentManager.java:2411) at android.support.v4.app.FragmentManagerImpl.removeRedundantOperationsAndExecute(FragmentManager.java:2366) at android.support.v4.app.FragmentManagerImpl.execPendingActions(FragmentManager.java:2273) at android.support.v4.app.FragmentManagerImpl$1.run(FragmentManager.java:733) at android.os.Handler.handleCallback(Handler.java:873) at android.os.Handler.dispatchMessage(Handler.java:99) at android.os.Looper.loop(Looper.java:193) at android.app.ActivityThread.main(ActivityThread.java:6669) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:858)

adamqure commented 5 years ago

This is a graceful recovery option in the case something crashes. It ends the game. However it is an important bug we need to address.

ZachClayburn commented 5 years ago

That makes sense, but in this case, it only booted the player who had the error, not the other players. If I wasn't not players, I wouldn't have any idea the game had crashed. Not that it is that important, it is a debug tool anyways.