New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NPE in QuestSystem when attempting to finish a sample quest #6

Open
Cervator opened this Issue Sep 10, 2016 · 2 comments

Comments

Projects
None yet
3 participants
@Cervator
Member

Cervator commented Sep 10, 2016

Happens when you run with QuestExamples, but the NPE occurs inside Tasks:

00:41:00.159 [Saving-0] INFO  o.t.p.internal.SaveTransaction - Save game finished
00:41:54.903 [main] INFO  o.t.tasks.systems.QuestSystem - Starting task CollectBlocksTask [0/3 block:core:Dirt]
00:41:54.903 [main] INFO  o.t.tasks.systems.QuestSystem - Starting task TimeConstraintTask [1m]
00:41:58.632 [main] INFO  o.t.p.i.ReadWriteStorageManager - Saving - Creating game snapshot
00:41:58.633 [main] INFO  o.t.p.i.ReadWriteStorageManager - Saving - Snapshot created: Writing phase starts
00:42:00.056 [Saving-0] INFO  o.t.p.internal.SaveTransaction - Save game finished
00:42:12.278 [main] INFO  o.t.tasks.systems.QuestSystem - Task CollectBlocksTask [3/3 block:core:Dirt] complete
00:42:12.279 [main] INFO  o.t.tasks.systems.QuestSystem - Starting task GoToBeaconTask [homeBeacon]
00:42:12.279 [main] INFO  o.t.tasks.systems.QuestSystem - Starting task TimeConstraintTask [30s]
00:42:21.077 [main] INFO  o.t.tasks.systems.QuestSystem - Task GoToBeaconTask [homeBeacon] complete
00:42:21.082 [main] ERROR o.t.e.event.internal.EventSystemImpl - Failed to invoke event
java.lang.NullPointerException: null
    at org.terasology.tasks.systems.QuestSystem.onTaskComplete(QuestSystem.java:82)
    at org.terasology.tasks.systems.QuestSystemMethodAccess.invoke(Unknown Source)
    at org.terasology.entitySystem.event.internal.EventSystemImpl$ByteCodeEventHandlerInfo.invoke(EventSystemImpl.java:506)
    at org.terasology.entitySystem.event.internal.EventSystemImpl.sendStandardEvent(EventSystemImpl.java:269)
    at org.terasology.entitySystem.event.internal.EventSystemImpl.send(EventSystemImpl.java:260)
    at org.terasology.entitySystem.entity.internal.BaseEntityRef.send(BaseEntityRef.java:145)
    at org.terasology.tasks.systems.QuestBeaconSystem.onCollision(QuestBeaconSystem.java:75)
    at org.terasology.tasks.systems.QuestBeaconSystemMethodAccess.invoke(Unknown Source)
    at org.terasology.entitySystem.event.internal.EventSystemImpl$ByteCodeEventHandlerInfo.invoke(EventSystemImpl.java:506)
    at org.terasology.entitySystem.event.internal.EventSystemImpl.sendStandardEvent(EventSystemImpl.java:269)
    at org.terasology.entitySystem.event.internal.EventSystemImpl.send(EventSystemImpl.java:260)
    at org.terasology.entitySystem.entity.internal.BaseEntityRef.send(BaseEntityRef.java:145)
    at org.terasology.physics.engine.PhysicsSystem.update(PhysicsSystem.java:170)
    at org.terasology.engine.modes.StateIngame.update(StateIngame.java:176)
    at org.terasology.engine.TerasologyEngine.mainLoop(TerasologyEngine.java:413)
    at org.terasology.engine.TerasologyEngine.run(TerasologyEngine.java:368)
    at org.terasology.engine.Terasology.main(Terasology.java:152)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:497)
    at com.intellij.rt.execution.application.AppMain.main(AppMain.java:147)
00:42:42.360 [main] INFO  o.t.tasks.systems.QuestSystem - Task TimeConstraintTask [30s] complete
00:42:58.648 [main] INFO  o.t.p.i.ReadWriteStorageManager - Saving - Creating game snapshot

@msteiger & @nh-99: ping! I keep forgetting we have this nice module. Fixed a build issue in Jenkins that was leaving the most recent binary broken.

--- Want to back this issue? **[Post a bounty on it!](https://www.bountysource.com/issues/37748064-npe-in-questsystem-when-attempting-to-finish-a-sample-quest?utm_campaign=plugin&utm_content=tracker%2F1165063&utm_medium=issues&utm_source=github)** We accept bounties via [Bountysource](https://www.bountysource.com/?utm_campaign=plugin&utm_content=tracker%2F1165063&utm_medium=issues&utm_source=github).

@Cervator Cervator added the bug label Sep 10, 2016

@nh-99

This comment has been minimized.

Show comment
Hide comment
@nh-99

nh-99 Sep 11, 2016

Contributor

Looks like on line 80 of the quest system file (https://github.com/Terasology/Tasks/blob/master/src/main/java/org/terasology/tasks/systems/QuestSystem.java#L80) there is a call to event.getQuest(). After that, there is no check to make sure that the quest is not null. So that's why it's getting a NullPointer. As for why the quest is null, for some reason it isn't being passed in the event that is being received on line 80. I can try to fix it if you'd like?

Contributor

nh-99 commented Sep 11, 2016

Looks like on line 80 of the quest system file (https://github.com/Terasology/Tasks/blob/master/src/main/java/org/terasology/tasks/systems/QuestSystem.java#L80) there is a call to event.getQuest(). After that, there is no check to make sure that the quest is not null. So that's why it's getting a NullPointer. As for why the quest is null, for some reason it isn't being passed in the event that is being received on line 80. I can try to fix it if you'd like?

@msteiger

This comment has been minimized.

Show comment
Hide comment
@msteiger

msteiger Sep 11, 2016

Member

Yes, please. That would be great!

Member

msteiger commented Sep 11, 2016

Yes, please. That would be great!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment