Default to no-op callbacks for #halt methods
This commit is contained in:
parent
d2b00c7d30
commit
48497b7b0e
|
@ -105,6 +105,7 @@ Cylon.config = function(key) {
|
||||||
//
|
//
|
||||||
// Returns nothing
|
// Returns nothing
|
||||||
Cylon.halt = function halt(callback) {
|
Cylon.halt = function halt(callback) {
|
||||||
|
callback = callback || function() {}
|
||||||
// if robots can't shut down quickly enough, forcefully self-terminate
|
// if robots can't shut down quickly enough, forcefully self-terminate
|
||||||
var timeout = Config.halt_timeout || 3000
|
var timeout = Config.halt_timeout || 3000
|
||||||
Utils.after(timeout, callback);
|
Utils.after(timeout, callback);
|
||||||
|
|
|
@ -285,6 +285,8 @@ Robot.prototype.startDevices = function(callback) {
|
||||||
//
|
//
|
||||||
// Returns nothing
|
// Returns nothing
|
||||||
Robot.prototype.halt = function(callback) {
|
Robot.prototype.halt = function(callback) {
|
||||||
|
callback = callback || function() {};
|
||||||
|
|
||||||
var fns = [];
|
var fns = [];
|
||||||
|
|
||||||
for (var d in this.devices) {
|
for (var d in this.devices) {
|
||||||
|
|
Loading…
Reference in New Issue