Skip to content
This repository was archived by the owner on Sep 14, 2019. It is now read-only.

Commit c154138

Browse files
committed
Added a try/catch in AutoUtils.parsePoint
1 parent 8ca27e3 commit c154138

1 file changed

Lines changed: 7 additions & 2 deletions

File tree

  • Robot2018/src/org/usfirst/frc/team199/Robot2018/autonomous

Robot2018/src/org/usfirst/frc/team199/Robot2018/autonomous/AutoUtils.java

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -246,8 +246,13 @@ public static double[] parsePoint(String cmdArgs) {
246246
if (AutoUtils.isPoint(cmdArgs)) {
247247
parentheseless = cmdArgs.substring(1, cmdArgs.length() - 1);
248248
pointparts = parentheseless.split(",");
249-
point[0] = Double.parseDouble(pointparts[0]);
250-
point[1] = Double.parseDouble(pointparts[1]);
249+
try {
250+
point[0] = Double.parseDouble(pointparts[0]);
251+
point[1] = Double.parseDouble(pointparts[1]);
252+
} catch (Exception e) {
253+
point[0] = 1;
254+
point[1] = 1;
255+
}
251256
}
252257
return point;
253258
}

0 commit comments

Comments
 (0)