Skip to content

Commit 506940d

Browse files
committed
avoid warning for undefined success and failure functions #162
1 parent 63ec39f commit 506940d

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

lib/mlrest.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1568,7 +1568,11 @@ function operationResultPromise(fullfilled, rejected) {
15681568
resolvedPromise(operation, resolve);
15691569
});
15701570

1571-
return promise.then(fullfilled, rejected);
1571+
switch(arguments.length) {
1572+
case 0: return promise.then();
1573+
case 1: return promise.then(fullfilled);
1574+
default: return promise.then(fullfilled, rejected);
1575+
}
15721576
}
15731577
function operationResultStream() {
15741578
var operation = this;

0 commit comments

Comments
 (0)