Skip to content

Commit

Permalink
Switch defaultGameUri to an actual Uri like 2.5. (#12055)
Browse files Browse the repository at this point in the history
This fixes the error where switching between 2.5 and 2.6 would produce illegal character errors in 2.5.
  • Loading branch information
asvitkine authored Oct 25, 2023
1 parent 45b1413 commit f7ec1a3
Showing 1 changed file with 3 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ private void setDefaultGame(@Nullable final Path xmlFile, @Nullable final GameDa
ClientSetting.defaultGameUri.resetValue();
} else {
ClientSetting.defaultGameName.setValue(gameData.getGameName());
ClientSetting.defaultGameUri.setValue(xmlFile.toAbsolutePath().toString());
ClientSetting.defaultGameUri.setValue(xmlFile.toUri().toString());
}
ClientSetting.flush();
}
Expand Down Expand Up @@ -213,9 +213,8 @@ private static boolean gameUriExistsOnFileSystem(final String gameUri) {
final Path gameFile = pathFromGameUri(gameUri);

// starts with check is because we don't want to load a game file by default that is not
// within
// the map folders. (ie: if a previous version of triplea was using running a game within its
// root folder, we shouldn't open it)
// within the map folders. (ie: if a previous version of triplea was using running a game
// within its root folder, we shouldn't open it)
return Files.exists(gameFile)
&& gameFile.startsWith(ClientFileSystemHelper.getUserRootFolder());
} catch (final IllegalArgumentException e) {
Expand Down

0 comments on commit f7ec1a3

Please sign in to comment.