EssentialsX

EssentialsX

2M Downloads

NPE when backup script is not executable

DuckDuckWhale opened this issue ยท 1 comments

commented

Type of bug

Error in console

/ess dump all output

Unlikely to be necessary. If you need any more information just ask.

Error log (if applicable)

No response

Bug description

When the specified backup script is not executable (-rw-------) (by accident), NPE shows up in console.

Steps to reproduce

In config.yml:

backup:
  interval: 30
  always-run: true
  command: './backup.sh'

Then: backup in console

Expected behaviour

No exception/error

Actual behaviour

[04:33:01 INFO]: [Essentials] Backup started.
[04:33:01 INFO]: Saving the game (this may take a moment!)
[04:33:01 INFO]: Saved the game
[04:33:01 INFO]: Automatic saving is now disabled
[04:33:01 WARN]: [Essentials] Plugin Essentials v2.19.5-dev+29-09dc49a generated an exception while executing task 52
java.lang.NullPointerException: Cannot invoke "String.length()" because "input" is null
        at net.kyori.adventure.text.serializer.legacy.LegacyComponentSerializerImpl.deserialize(LegacyComponentSerializerImpl.java:242) ~[adventure-text-serializer-legacy-4.11.0.jar:?]
        at net.ess3.provider.providers.PaperLoggerProvider.doTheLog(PaperLoggerProvider.java:21) ~[EssentialsX-2.19.5-dev+29-09dc49a.jar:?]
        at net.ess3.provider.LoggerProvider.log(LoggerProvider.java:25) ~[EssentialsX-2.19.5-dev+29-09dc49a.jar:?]
        at com.earth2me.essentials.Backup.lambda$run$1(Backup.java:110) ~[EssentialsX-2.19.5-dev+29-09dc49a.jar:?]
        at org.bukkit.craftbukkit.v1_19_R1.scheduler.CraftTask.run(CraftTask.java:101) ~[paper-1.19.jar:git-Paper-61]
        at org.bukkit.craftbukkit.v1_19_R1.scheduler.CraftAsyncTask.run(CraftAsyncTask.java:57) ~[paper-1.19.jar:git-Paper-61]
        at com.destroystokyo.paper.ServerSchedulerReportingWrapper.run(ServerSchedulerReportingWrapper.java:22) ~[paper-1.19.jar:?]
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136) ~[?:?]
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635) ~[?:?]
        at java.lang.Thread.run(Thread.java:833) ~[?:?]
[04:33:01 INFO]: Automatic saving is now enabled
[04:33:01 INFO]: [Essentials] Backup finished.
commented

Interesting issue, not sure if this is something we fix or if fixing it would just bubble up with a different error. A better message might be nice though.