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 in ScriptingData if FileWatcher was not initialized #18

Merged
merged 1 commit into from
Oct 22, 2024

Conversation

ccrvincent
Copy link
Contributor

Saw this NPE during shutdown after a crash in a crashlog in a support forum.

@CLAassistant
Copy link

CLAassistant commented Oct 22, 2024

CLA assistant check
All committers have signed the CLA.

@rubensworks
Copy link
Member

Thanks @ccrvincent!
Before I merge, could you point to the support forum?
Because I'd like to know a bit more on the context of the problem.

@ccrvincent
Copy link
Contributor Author

ccrvincent commented Oct 22, 2024

It's a Discord, and all I got was the crash report so far. They were getting crashes when trying to connect to a server running a modpack with IntegratedScripting in it. Looks like the shutdown hook was confusing the logger with the NPE.

Description: Exception in server tick loop

java.lang.NullPointerException: Cannot invoke "java.nio.file.WatchService.close()" because "this.watchService" is null
	at TRANSFORMER/[email protected]/org.cyclops.integratedscripting.core.network.ScriptingData.close(ScriptingData.java:82) ~[IntegratedScripting-1.21-neoforge-1.0.5.jar%23544!/:1.0.5] {re:classloading}
	at TRANSFORMER/[email protected]/org.cyclops.integratedscripting.IntegratedScripting.onServerStopping(IntegratedScripting.java:117) ~[IntegratedScripting-1.21-neoforge-1.0.5.jar%23544!/:1.0.5] {re:classloading,pl:runtimedistcleaner:A}
	at MC-BOOTSTRAP/net.neoforged.bus/net.neoforged.bus.ConsumerEventHandler.invoke(ConsumerEventHandler.java:26) ~[bus-8.0.2.jar%2367!/:?] {}
	at MC-BOOTSTRAP/net.neoforged.bus/net.neoforged.bus.EventBus.post(EventBus.java:350) ~[bus-8.0.2.jar%2367!/:?] {}
	at MC-BOOTSTRAP/net.neoforged.bus/net.neoforged.bus.EventBus.post(EventBus.java:315) ~[bus-8.0.2.jar%2367!/:?] {}
	at TRANSFORMER/[email protected]/net.neoforged.neoforge.server.ServerLifecycleHooks.handleServerStopping(ServerLifecycleHooks.java:118) ~[neoforge-21.1.66-universal.jar%23409!/:?] {re:mixin,re:classloading,pl:mixin:APP:almostunified-neoforge.mixins.json:worldgen.ServerLifecycleHooksMixin from mod almostunified,pl:mixin:A}
	at TRANSFORMER/[email protected]/net.minecraft.server.MinecraftServer.runServer(MinecraftServer.java:724) ~[server-1.21.1-20240808.144430-srg.jar%23408!/:?] {re:mixin,pl:accesstransformer:B,re:classloading,pl:accesstransformer:B,pl:mixin:A}
	at TRANSFORMER/[email protected]/net.minecraft.server.MinecraftServer.lambda$spin$2(MinecraftServer.java:267) ~[server-1.21.1-20240808.144430-srg.jar%23408!/:?] {re:mixin,pl:accesstransformer:B,re:classloading,pl:accesstransformer:B,pl:mixin:A}
	at java.base/java.lang.Thread.run(Thread.java:1583) [?:?] {re:mixin}

@rubensworks
Copy link
Member

I see, thanks for the info!

@rubensworks rubensworks merged commit fa87073 into CyclopsMC:master-1.21 Oct 22, 2024
2 checks passed
@ccrvincent ccrvincent deleted the patch-1 branch October 22, 2024 14:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

3 participants