diff --git a/roseus/euslisp/actionlib.l b/roseus/euslisp/actionlib.l index b44be29e6..6f250ce78 100644 --- a/roseus/euslisp/actionlib.l +++ b/roseus/euslisp/actionlib.l @@ -221,7 +221,12 @@ (if (eq (send self :get-state) actionlib_msgs::GoalStatus::*preempted*) (ros::ros-warn "[~A] :wait-for-result finished with preempted status" name-space)) (eq (send self :get-state) actionlib_msgs::GoalStatus::*succeeded*))) - (:get-result () (send (send comm-state :latest-result) :result)) + (:get-result () + (if (send comm-state :latest-result) + (send (send comm-state :latest-result) :result) + (progn + (ros::ros-error "[~A] :get-result called without sending goal, returns null result" name-space) + nil))) ;; return nil instead of (instance action-result-class :init) (:get-state () (let (state) (setq state (send (send comm-state :latest-goal-status) :status)) diff --git a/roseus/test/test-actionlib.test b/roseus/test/test-actionlib.test index 4b8d610b0..7dd334fff 100644 --- a/roseus/test/test-actionlib.test +++ b/roseus/test/test-actionlib.test @@ -3,5 +3,7 @@ +