Skip to content
This repository has been archived by the owner on Jan 16, 2019. It is now read-only.

Commit

Permalink
don't show file tag errors when there's a fallback
Browse files Browse the repository at this point in the history
  • Loading branch information
mcmonkey4eva committed Jan 14, 2019
1 parent 572249f commit 98a9c37
Showing 1 changed file with 9 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -499,7 +499,9 @@ public void serverTag(ReplaceableTagEvent event) {
File f = new File(DenizenAPI.getCurrentInstance().getDataFolder(), attribute.getContext(1));
try {
if (!Utilities.canReadFile(f)) {
dB.echoError("Invalid path specified. Invalid paths have been denied by the server administrator.");
if (!attribute.hasAlternative()) {
dB.echoError("Invalid path specified. Invalid paths have been denied by the server administrator.");
}
return;
}
}
Expand All @@ -521,11 +523,15 @@ public void serverTag(ReplaceableTagEvent event) {
File folder = new File(DenizenAPI.getCurrentInstance().getDataFolder(), attribute.getContext(1));
try {
if (!Utilities.canReadFile(folder)) {
dB.echoError("Invalid path specified. Invalid paths have been denied by the server administrator.");
if (!attribute.hasAlternative()) {
dB.echoError("Invalid path specified. Invalid paths have been denied by the server administrator.");
}
return;
}
if (!folder.exists() || !folder.isDirectory()) {
dB.echoError("Invalid path specified. No directory exists at that path.");
if (!attribute.hasAlternative()) {
dB.echoError("Invalid path specified. No directory exists at that path.");
}
return;
}
}
Expand Down

0 comments on commit 98a9c37

Please sign in to comment.