From d9669ddcd5d7c67ac4a9c052209da5bb05545ce7 Mon Sep 17 00:00:00 2001 From: yugecin Date: Tue, 13 Dec 2016 15:22:23 +0100 Subject: [PATCH] gracefully handle error when loading all beatmaps (close #110) --- src/itdelatrisu/opsu/beatmap/BeatmapParser.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/itdelatrisu/opsu/beatmap/BeatmapParser.java b/src/itdelatrisu/opsu/beatmap/BeatmapParser.java index 1016aad3..0f293ead 100644 --- a/src/itdelatrisu/opsu/beatmap/BeatmapParser.java +++ b/src/itdelatrisu/opsu/beatmap/BeatmapParser.java @@ -151,7 +151,12 @@ public class BeatmapParser { // Parse hit objects only when needed to save time/memory. // Change boolean to 'true' to parse them immediately. - Beatmap beatmap = parseFile(file, dir, beatmaps, false); + Beatmap beatmap = null; + try { + beatmap = parseFile(file, dir, beatmaps, false); + } catch(Exception e) { + Log.error("could not parse beatmap " + file.getName() + ": " + e.getMessage()); // TODO: show right bottom notification + } // add to parsed beatmap list if (beatmap != null) {