The line of code below will throw a null reference exception when attempting to use the GraphicalClient instead of TextClient in student ship programs:
|
cmd = (ShipCommand)shipType.getMethod("getNextCommand", Environment.class).invoke(ship, env); |
The issue appears to be that instead of assigning to the field shipType at line 75 the code instead assigns to a local variable leaving the field with a null value:
|
Class<?> shipType = Class.forName(this.shipClassname); |
The line of code below will throw a null reference exception when attempting to use the
GraphicalClientinstead ofTextClientin student ship programs:SpaceBattleArena/java_client_src/src/ihs/apcs/spacebattle/GraphicalClient.java
Line 129 in 9e4a7bb
The issue appears to be that instead of assigning to the field
shipTypeat line 75 the code instead assigns to a local variable leaving the field with a null value:SpaceBattleArena/java_client_src/src/ihs/apcs/spacebattle/GraphicalClient.java
Line 75 in 9e4a7bb