Skip to content
This repository was archived by the owner on Feb 9, 2022. It is now read-only.

Commit b185ecc

Browse files
ExplvExplv
authored andcommitted
Fix log file paths
1 parent 1c507be commit b185ecc

File tree

2 files changed

+12
-2
lines changed

2 files changed

+12
-2
lines changed

pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
<groupId>org.explv.explv_osbot_manager</groupId>
88
<artifactId>explv_osbot_manager</artifactId>
9-
<version>v2.0.5</version>
9+
<version>v2.0.6</version>
1010
<repositories>
1111
<repository>
1212
<id>local-repo</id>

src/main/java/bot_parameters/configuration/Configuration.java

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -252,8 +252,12 @@ private void readObject(ObjectInputStream stream) throws ClassNotFoundException,
252252
}
253253
try {
254254
logFileName = (String) stream.readObject();
255+
File logFile = new File(logFileName);
256+
if (!logFile.exists()) {
257+
logFileName = Paths.get(Settings.LOGS_DIR, UUID.randomUUID().toString()).toString();
258+
}
255259
} catch (Exception e) {
256-
logFileName = Paths.get(System.getProperty("user.home"), "ExplvOSBotManager", "Logs", UUID.randomUUID().toString()).toString();
260+
logFileName = Paths.get(Settings.LOGS_DIR, UUID.randomUUID().toString()).toString();
257261
}
258262
isRunning = new SimpleBooleanProperty();
259263
}
@@ -356,6 +360,12 @@ public void run() throws IOException {
356360
throw new IllegalStateException("Could not create log file");
357361
}
358362

363+
OSBotAccount osBotAccount = OSBotAccount.getInstance();
364+
365+
if (osBotAccount.getUsername().trim().isEmpty() || osBotAccount.getPassword().isEmpty()) {
366+
Platform.runLater(() -> new ExceptionDialog(new Exception("OSBot account username or password is empty!")).show());
367+
}
368+
359369
Thread runThread = new Thread(() -> {
360370

361371
try (BufferedWriter br = new BufferedWriter(new FileWriter(logFile))) {

0 commit comments

Comments
 (0)