fix: GameService.load() NPE on null bundleFile + ZipService test path
Build & Deploy / build-and-deploy (push) Successful in 48s
Build & Deploy / build-and-deploy (push) Successful in 48s
- GameService.load(): null-check bundleFile before resolving path (Path.resolve(null) throws NullPointerException) - ZipServiceTest: pass absolute exePath to createBundle (relativize requires both paths to be absolute or both relative)
This commit is contained in:
@@ -77,9 +77,12 @@ public class GameService implements GameStore {
|
||||
);
|
||||
// Detect bundle size
|
||||
try {
|
||||
Path bundlePath = gamesDir.resolve(game.getBundleFile());
|
||||
if (Files.exists(bundlePath)) {
|
||||
game.setBundleSize(Files.size(bundlePath));
|
||||
String bf = game.getBundleFile();
|
||||
if (bf != null) {
|
||||
Path bundlePath = gamesDir.resolve(bf);
|
||||
if (Files.exists(bundlePath)) {
|
||||
game.setBundleSize(Files.size(bundlePath));
|
||||
}
|
||||
}
|
||||
} catch (IOException ignored) {}
|
||||
return game;
|
||||
|
||||
Reference in New Issue
Block a user