From c2d9e64622e695eb0337f89b45de8811a7763920 Mon Sep 17 00:00:00 2001 From: Peter Date: Wed, 11 May 2022 16:28:25 -0400 Subject: [PATCH] fix None condition --- arm_robots/src/arm_robots/robot.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/arm_robots/src/arm_robots/robot.py b/arm_robots/src/arm_robots/robot.py index 35add9c..b77b392 100644 --- a/arm_robots/src/arm_robots/robot.py +++ b/arm_robots/src/arm_robots/robot.py @@ -290,7 +290,9 @@ def _feedback_cb(feedback: FollowJointTrajectoryFeedback): result = client.get_result() failure = (result is None or result.error_code != FollowJointTrajectoryResult.SUCCESSFUL) if self.raise_on_failure and failure: - raise RuntimeError(f"Follow Joint Trajectory Failed: ({result.error_code}) {result.error_string}") + if result is not None: + raise RuntimeError(f"Follow Joint Trajectory Failed: ({result.error_code}) {result.error_string}") + raise RuntimeError(f"Follow Joint Trajectory Failed: (???)") success = result is not None and result.error_code == FollowJointTrajectoryResult.SUCCESSFUL return ExecutionResult(trajectory=trajectory,