Skip to content

Commit

Permalink
Fixes crash when no object is found to be started
Browse files Browse the repository at this point in the history
  • Loading branch information
Baltasarq committed Apr 30, 2024
1 parent 47c101d commit dd7c9a8
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions lib/verbs.js
Original file line number Diff line number Diff line change
Expand Up @@ -167,14 +167,16 @@ startAction.doIt = function(s) {
toret = "Deberías especificar qué.";
}
else {
if ( typeof( objDest.preStart ) === "function" ) {
toret = objDest.preStart();
} else {
toret = this.exe( s );
}
if ( objDest != null ) {
if ( typeof( objDest.preStart ) === "function" ) {
toret = objDest.preStart();
} else {
toret = this.exe( s );
}

if ( typeof( objDest.postStart ) === "function" ) {
objDest.postStart();
if ( typeof( objDest.postStart ) === "function" ) {
objDest.postStart();
}
}
}

Expand Down

0 comments on commit dd7c9a8

Please sign in to comment.