Skip to content

Commit

Permalink
fix None condition
Browse files Browse the repository at this point in the history
  • Loading branch information
Peter committed May 11, 2022
1 parent c0171e9 commit c2d9e64
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion arm_robots/src/arm_robots/robot.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit c2d9e64

Please sign in to comment.