Closed jamesremuscat closed 6 years ago
Odd, I thought it would do everything automatically... does the HeadsPlus folder exist, and if it does, is there a folder in there called "storage"? I'll test this now - then again, that sucks with Java, not mentioning what exists and what doesn't...
Reproduced using 1.13 Spigot. Will make a quick fix now.
The issue I found here was not the fact that the plugin couldn't find its own data folder - that was created fine. The storage folder where favourites.json is created, however, was not, hence why the plugin retaliated by breaking.
If the data folder wasn't there, however, you would end up with a second error as the plugin tries to create a debug report regarding the error that was thrown. Mostly because not everyone knows how to handle bug reporting, and I've already had one close shave on the Spigot reviews. So far, I've been lucky.
In the meantime. Just fixed this and will upload the new jar to Spigot (version 4.8.9.1). Thank you for your cooperation on reporting this.
Short summary of issue
When running HeadsPlus on a server for the first time,
java.io.IOException: No such file or directory
is thrown fromFavourites#create
called fromHeadsPlus.java:312
.Server version
git-Bukkit-1ef1ffd (MC: 1.13)
HeadsPlus version
4.8.9
Detailed description (how you found it, what you were doing at the time)
Installing plugin to a fresh server with no other plugins installed.
Expected behaviour
HeadsPlus to check data folder exists (and/or wait for it to be created and/or create it) before attempting to write to it
Actual behaviour
HP tries to write to data folder before it exists.
Steps to reproduce
Load plugin JAR into fresh server's
plugins
folder; start server.Any last notes?
Bukkit's docs say that
getDataFolder()
:Might just be a race condition and in this instance this code just happened to execute before the data folder was created; restarting the server once the data folder had been created then works fine and the
favourites.json
file is created as it should be.