Skip to content
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

Fix NPE on inventory view & modernize code #1255

Merged
merged 1 commit into from
Oct 15, 2023
Merged

Fix NPE on inventory view & modernize code #1255

merged 1 commit into from
Oct 15, 2023

Conversation

Pablete1234
Copy link
Member

It appears if the user is viewing a non-player inventory, and it disapears (assuming a chest that is broken, or another entity that dies) it will keep on posting this NPE for the rest of the match, once per second.

[17:31:45 WARN]: java.lang.NullPointerException                                                                                                                                                                   
[17:31:45 WARN]:        at tc.oc.pgm.inventory.ViewInventoryMatchModule.checkMonitoredInventories(ViewInventoryMatchModule.java:292)                                                                              
[17:31:45 WARN]:        at tc.oc.pgm.inventory.ViewInventoryMatchModule.checkAllMonitoredInventories(ViewInventoryMatchModule.java:100)                                                                           
[17:31:45 WARN]:        at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)                                                                                                                
[17:31:45 WARN]:        at tc.oc.pgm.util.concurrent.TaskExecutorService$Task.run(TaskExecutorService.java:228)                                                                                                   
[17:31:45 WARN]:        at org.bukkit.craftbukkit.v1_8_R3.scheduler.CraftTask.run(CraftTask.java:64)                                                                                                              
[17:31:45 WARN]:        at org.bukkit.craftbukkit.v1_8_R3.scheduler.CraftScheduler.mainThreadHeartbeat(CraftScheduler.java:412)                                                                                   
[17:31:45 WARN]:        at net.minecraft.server.v1_8_R3.MinecraftServer.B(MinecraftServer.java:900)                                                                                                               
[17:31:45 WARN]:        at net.minecraft.server.v1_8_R3.DedicatedServer.B(DedicatedServer.java:385)                                                                                                               
[17:31:45 WARN]:        at net.minecraft.server.v1_8_R3.MinecraftServer.A(MinecraftServer.java:827)                                                                                                               
[17:31:45 WARN]:        at net.minecraft.server.v1_8_R3.MinecraftServer.run(MinecraftServer.java:728)                                                                                                             
[17:31:45 WARN]:        at java.lang.Thread.run(Thread.java:750)     

The change addresses that, and also revamps the code, since it was still matching players by name!! (this code is predating the UUID change 😅).

@Pablete1234 Pablete1234 added the bug Something isn't working label Oct 13, 2023
@Electroid Electroid merged commit 3e56501 into dev Oct 15, 2023
2 checks passed
@Electroid Electroid deleted the fix-inv-view-npe branch October 15, 2023 04:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Development

Successfully merging this pull request may close these issues.

3 participants