APickledWalrus / skript-placeholders

Placeholder integration for Skript.
GNU General Public License v3.0
28 stars 8 forks source link

[BUG] Cannot return player‘s forge status while working with ClientDetector #49

Closed fr1g closed 9 months ago

fr1g commented 9 months ago

Description

Skript reported errors that caused by ClientDetector just because a method returns null. Since this addon is the one which should process any kind of returns including "null".

Steps to Reproduce

install CD and try to get placeholder "clientdetector_forge_user" in sk.

Expected Behavior

It should get null and return the value as string "" back to sk.

Errors / Screenshots

 Stack trace:
[20:21:47] [Server thread/ERROR]: #!#! java.lang.NullPointerException: Cannot invoke "de.sportkanone123.clientdetector.spigot.forgemod.ModList.getMods()" because the return value of "java.util.HashMap.get(Object)" is null
[20:21:47] [Server thread/ERROR]: #!#!     at de.sportkanone123.clientdetector.spigot.manager.PlaceholderManager.onPlaceholderRequest(PlaceholderManager.java:61)
[20:21:47] [Server thread/ERROR]: #!#!     at me.clip.placeholderapi.PlaceholderHook.onRequest(PlaceholderHook.java:38)
[20:21:47] [Server thread/ERROR]: #!#!     at me.clip.placeholderapi.PlaceholderAPI.setPlaceholders(PlaceholderAPI.java:326)
[20:21:47] [Server thread/ERROR]: #!#!     at me.clip.placeholderapi.PlaceholderAPI.setPlaceholders(PlaceholderAPI.java:288)
[20:21:47] [Server thread/ERROR]: #!#!     at me.clip.placeholderapi.PlaceholderAPI.setPlaceholders(PlaceholderAPI.java:261)
[20:21:47] [Server thread/ERROR]: #!#!     at io.github.apickledwalrus.skriptplaceholders.skript.util.PlaceholderUtils.getPlaceholder(PlaceholderUtils.java:31)
[20:21:47] [Server thread/ERROR]: #!#!     at io.github.apickledwalrus.skriptplaceholders.skript.elements.expressions.ExprParsePlaceholder.get(ExprParsePlaceholder.java:70)
[20:21:47] [Server thread/ERROR]: #!#!     at io.github.apickledwalrus.skriptplaceholders.skript.elements.expressions.ExprParsePlaceholder.get(ExprParsePlaceholder.java:23)
[20:21:47] [Server thread/ERROR]: #!#!     at ch.njol.skript.lang.util.SimpleExpression.getArray(SimpleExpression.java:101)
[20:21:47] [Server thread/ERROR]: #!#!     at ch.njol.skript.effects.EffChange.execute(EffChange.java:272)

Server Information

Additional Context

APickledWalrus commented 9 months ago

This is not really something for me to handle. The issue is coming from within the plugin itself, so it's up to them to fix it.

fr1g commented 9 months ago

If you think parsing a null is not your business, then I will push the issue to CD’s repo. I commit this issue to your place just because this stack trace printed by Skript… :P

2023年10月24日 12:22,Patrick Miller @.***> 写道:

This is not really something for me to handle. The issue is coming from within the plugin itself, so it's up to them to fix it.

— Reply to this email directly, view it on GitHub https://github.com/APickledWalrus/skript-placeholders/issues/49#issuecomment-1776518026, or unsubscribe https://github.com/notifications/unsubscribe-auth/AMVALPG5GSVQZIZ6GQVMA4DYA47BPAVCNFSM6AAAAAA6NBKMF2VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTONZWGUYTQMBSGY. You are receiving this because you authored the thread.

APickledWalrus commented 9 months ago

The stacktracke includes this plugin (as it is the one trying to obtain the value), but it is ClientDetector itself that is ultimately the cause.