From 961ea097c712880c3532bb358132a2efadf687a5 Mon Sep 17 00:00:00 2001 From: yugecin Date: Sat, 10 Dec 2016 17:19:45 +0100 Subject: [PATCH] fix crashing caused by merged slider when map doesn't have sliders --- src/itdelatrisu/opsu/states/Game.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/itdelatrisu/opsu/states/Game.java b/src/itdelatrisu/opsu/states/Game.java index 74c25464..10c75d10 100644 --- a/src/itdelatrisu/opsu/states/Game.java +++ b/src/itdelatrisu/opsu/states/Game.java @@ -1534,7 +1534,9 @@ public class Game extends BasicGameState { curvepoints.addAll(Arrays.asList(((Slider) gameObject).getCurve().getCurvePoints())); } } - knorkesliders = new FakeCombinedCurve(curvepoints.toArray(new Vec2f[curvepoints.size()])); + if (curvepoints.size() > 0) { + knorkesliders = new FakeCombinedCurve(curvepoints.toArray(new Vec2f[curvepoints.size()])); + } } } @@ -1603,7 +1605,7 @@ public class Game extends BasicGameState { * @param trackPosition the track position */ private void drawHitObjects(Graphics g, int trackPosition) { - if (Options.isMergingSliders()) { + if (Options.isMergingSliders() && knorkesliders != null) { knorkesliders.draw(Color.white, this.slidercurveFrom, this.slidercurveTo); } // include previous object in follow points