Fix segfaults in spline UI
I suspect that this actually started happening when Python upgrades
happened, since the previous logic was checking for zero-length
trajectories, but it looks like numpy may now manage zero-length arrays
differently than it did previousl.
Change-Id: Id4212d0c7ea6efcf47295841c92de3aad79072a5
diff --git a/frc971/control_loops/python/graph.py b/frc971/control_loops/python/graph.py
index 5f68444..3063bd1 100644
--- a/frc971/control_loops/python/graph.py
+++ b/frc971/control_loops/python/graph.py
@@ -43,7 +43,7 @@
mypoints.addConstraintsToTrajectory(traj)
traj.Plan()
XVA = traj.GetPlanXVA(dT)
- if len(XVA[0]) > 0:
+ if XVA is not None:
self.draw_x_axis(cr, start, height, zero, XVA, end)
self.drawVelocity(cr, XVA, start, height, skip, zero, end,
legend_entries)