Skip empty files in DebugPaste

This commit is contained in:
Sauilitired 2019-01-10 21:34:52 +01:00
parent 3bbd97e7e1
commit 3ac7785cc3
No known key found for this signature in database
GPG Key ID: C0207FF7EA146678

View File

@ -82,9 +82,23 @@ import java.util.List;
"&clatest.log is too big to be pasted, will ignore");
}
incendoPaster.addFile(new IncendoPaster.PasteFile("settings.yml", readFile(PlotSquared.get().configFile)));
incendoPaster.addFile(new IncendoPaster.PasteFile("worlds.yml", readFile(PlotSquared.get().worldsFile)));
incendoPaster.addFile(new IncendoPaster.PasteFile("PlotSquared.use_THIS.yml", readFile(PlotSquared.get().translationFile)));
try {
incendoPaster.addFile(new IncendoPaster.PasteFile("settings.yml", readFile(PlotSquared.get().configFile)));
} catch (final IllegalArgumentException ignored) {
MainUtil.sendMessage(player, "&cSkipping settings.yml because it's empty");
}
try {
incendoPaster.addFile(new IncendoPaster.PasteFile("worlds.yml", readFile(PlotSquared.get().worldsFile)));
} catch (final IllegalArgumentException ignored) {
MainUtil.sendMessage(player, "&cSkipping worlds.yml because it's empty");
}
try {
incendoPaster.addFile(new IncendoPaster.PasteFile("PlotSquared.use_THIS.yml",
readFile(PlotSquared.get().translationFile)));
} catch (final IllegalArgumentException ignored) {
MainUtil.sendMessage(player, "&cSkipping PlotSquared.use_THIS.yml because it's empty");
}
try {
final String rawResponse = incendoPaster.upload();
final JsonObject jsonObject = new JsonParser().parse(rawResponse).getAsJsonObject();