File tree Expand file tree Collapse file tree 1 file changed +7
-7
lines changed Expand file tree Collapse file tree 1 file changed +7
-7
lines changed Original file line number Diff line number Diff line change @@ -151,12 +151,10 @@ class Action extends EventEmitter2 {
151151 *
152152 * @param {Object } rosbridgeRequest - The ROSLIB.ActionGoal to send.
153153 * @param {string } rosbridgeRequest.id - The ID of the action goal.
154+ * @param {TGoal } rosbridgeRequest.args - The arguments of the action goal.
154155 */
155156 _executeAction ( rosbridgeRequest ) {
156- var id ;
157- if ( rosbridgeRequest . id ) {
158- id = rosbridgeRequest . id ;
159- }
157+ var id = rosbridgeRequest . id ;
160158
161159 // If a cancellation callback exists, call it when a cancellation event is emitted.
162160 if ( typeof id === 'string' ) {
@@ -167,9 +165,11 @@ class Action extends EventEmitter2 {
167165 } ) ;
168166 }
169167
170- // Call the goal execution function provided.
171- // @ts -expect-error -- possibly null
172- this . _actionCallback ( rosbridgeRequest . args , id ) ;
168+ // Call the action goal execution function provided.
169+ if ( typeof this . _actionCallback === 'function' )
170+ {
171+ this . _actionCallback ( rosbridgeRequest . args , id ) ;
172+ }
173173 }
174174
175175 /**
You can’t perform that action at this time.
0 commit comments