From 66d2814d275d4b6115c6d82a39185e4b5c5df69d Mon Sep 17 00:00:00 2001 From: Michael Jansen Date: Sun, 6 Oct 2024 11:14:34 -0700 Subject: [PATCH] fix PathPlannerAuto always running Commands.none (#822) --- .../java/com/pathplanner/lib/commands/PathPlannerAuto.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pathplannerlib/src/main/java/com/pathplanner/lib/commands/PathPlannerAuto.java b/pathplannerlib/src/main/java/com/pathplanner/lib/commands/PathPlannerAuto.java index 928d3421..505427d3 100644 --- a/pathplannerlib/src/main/java/com/pathplanner/lib/commands/PathPlannerAuto.java +++ b/pathplannerlib/src/main/java/com/pathplanner/lib/commands/PathPlannerAuto.java @@ -57,13 +57,14 @@ public PathPlannerAuto(String autoName) { initFromJson(json); } catch (FileNotFoundException e) { DriverStation.reportError(e.getMessage(), e.getStackTrace()); + autoCommand = Commands.none(); } catch (IOException e) { DriverStation.reportError( "Failed to read file required by auto: " + autoName, e.getStackTrace()); + autoCommand = Commands.none(); } catch (ParseException e) { DriverStation.reportError( "Failed to parse JSON in file required by auto: " + autoName, e.getStackTrace()); - } finally { autoCommand = Commands.none(); }