Skip to content

Commit

Permalink
Fixed crashing (but not resources yet)
Browse files Browse the repository at this point in the history
  • Loading branch information
onixiya1337 committed Dec 30, 2023
1 parent e96a193 commit 2016048
Showing 1 changed file with 10 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,15 @@ public void playRandomRecording(String pattern) {
try {
List<String> resourceFiles = getResourceFiles();

if (resourceFiles == null) {
if (FailsafeManager.getInstance().triggeredFailsafe.isPresent()) {
LogUtils.sendError("Resource folder not found! Report this to #bug-reports!");
}
stop();
resetStatesAfterMacroDisabled();
return;
}

for (String file : resourceFiles) {
if (file.contains(pattern)) {
matchingFiles.add(file);
Expand Down Expand Up @@ -367,7 +376,7 @@ private static List<String> getResourceFiles() throws IOException, URISyntaxExce
URL resourceFolder = classLoader.getResource("farmhelper/movrec");

if (resourceFolder == null) {
LogUtils.sendError("Resource folder not found! Report this to #bug-reports!");
return null;
}

URI uri = resourceFolder.toURI();
Expand Down

0 comments on commit 2016048

Please sign in to comment.