Bug 559 - Runtime exception occurrs during game initialization
Summary: Runtime exception occurrs during game initialization
Status: RESOLVED FIXED
Alias: None
Product: Group14-Pacman
Classification: Unclassified
Component: Game (show other bugs)
Version: 0.0.1
Hardware: PC Windows
: --- major
Assignee: Omar MOUSTAFA
URL:
Depends on:
Blocks:
 
Reported: 2021-11-13 17:52 HKT by YANG Tianxia
Modified: 2021-12-06 22:53 HKT (History)
0 users

See Also:


Attachments
Proposed bug fix (1.58 KB, text/plain)
2021-11-13 18:02 HKT, YANG Tianxia
Details

Note You need to log in before you can comment on or make changes to this bug.
Description YANG Tianxia 2021-11-13 17:52:43 HKT
During the initialization of the game, the following runtime exception is thrown right after the console prints out the maze.

Expected output:
W W W W W W W W W W W W W W W W W W W W W W W W W W W W W 
W                                                       W 
W   W W W W W W W W W W   W W W   W W W W W W W W W W   W 
W   W W W W W W W W W W   W W W   W W W W W W W W W W   W 
W   W W W W W W W         W W W         W W W W W W W   W 
W               W   W W W W W W W W W   W               W 
W W W W W W W   W   W W W W W W W W W   W   W W W W W W W 
n n n n n n W   W   W W W W W W W W W   W   W n n n n n n 
n n n n n n W                               W n n n n n n 
n n n n n n W   W   W W W W W W W W W   W   W n n n n n n 
n n n W W W W   W   W W W W W W W W W   W   W W W W n n n 
n n n W         W   W W W W W W W W W   W         W n n n 
n n n W   W W W W                       W W W W   W n n n 
n W W W   W W W W   W W W W n W W W W   W W W W   W W W n 
n W                 W n n n n n n n W                 W n 
n W   W W W   W W   W n n n n n n n W   W W   W W W   W n 
n W   W W W   W W   W n n n n n n n W   W W   W W W   W n 
n W       W   W W   W W W W W W W W W   W W   W       W n 
n W W W   W   W W                       W W   W   W W W n 
n n n W   W   W W W W   W W W W W   W W W W   W   W n n n 
W W W W   W   W W W W   W W W W W   W W W W   W   W W W W 
W                       W W W W W                       W 
W W W W   W W W W   W W W W W W W W W   W W W W   W W W W 
n n n W   W W W W   W W W W W W W W W   W W W W   W n n n 
n n n W   W                                   W   W n n n 
n n n W   W   W W W W   W W W W W   W W W W   W   W n n n 
n W W W   W   W W W W   W W W W W   W W W W   W   W W W n 
n W           W W       W W W W W       W W           W n 
n W   W W W   W W   W W W W W W W W W   W W   W W W   W n 
n W   W W W   W W   W W W W W W W W W   W W   W W W   W n 
n W           W W                       W W           W n 
n W W W W W W W W W W W W W W W W W W W W W W W W W W W n 
Type in a command (Up, Down, Left, Right, Reset): 

Actual output:
        [the maze part is the same, omitted]
java.lang.NullPointerException
	at Game.Frightened.addAlgorithm(Frightened.java:15)
	at Game.Ghost.initGhosts(Ghost.java:46)
	at Game.Game.gameInit(Game.java:26)
	at Game.Main.main(Main.java:18)
Maze has already been generated!


Steps to Reproduce: simply run the Main.java as Java Application, and the exception will be thrown.

JVM Clent Information:
eclipse.buildId=4.20.0.I20210611-1600
java.version=11.0.2
java.vendor=Oracle Corporation
BootLoader constants: OS=win32, ARCH=x86_64, WS=win32, NL=zh_CN
Framework arguments:  -product org.eclipse.epp.package.java.product
Command-line arguments:  -os win32 -ws win32 -arch x86_64 -product org.eclipse.epp.package.java.product
Comment 1 YANG Tianxia 2021-11-13 18:02:29 HKT
Created attachment 76 [details]
Proposed bug fix

This is my proposed bug fix