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 {
151
151
*
152
152
* @param {Object } rosbridgeRequest - The ROSLIB.ActionGoal to send.
153
153
* @param {string } rosbridgeRequest.id - The ID of the action goal.
154
+ * @param {TGoal } rosbridgeRequest.args - The arguments of the action goal.
154
155
*/
155
156
_executeAction ( rosbridgeRequest ) {
156
- var id ;
157
- if ( rosbridgeRequest . id ) {
158
- id = rosbridgeRequest . id ;
159
- }
157
+ var id = rosbridgeRequest . id ;
160
158
161
159
// If a cancellation callback exists, call it when a cancellation event is emitted.
162
160
if ( typeof id === 'string' ) {
@@ -167,9 +165,11 @@ class Action extends EventEmitter2 {
167
165
} ) ;
168
166
}
169
167
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
+ }
173
173
}
174
174
175
175
/**
You can’t perform that action at this time.
0 commit comments