test if cb exists

Signed-off-by: Clark Wang <clark.wangs@gmail.com>
This commit is contained in:
Clark Wang 2014-12-10 19:03:48 +08:00
parent b204367aa6
commit 7a3e254403
1 changed files with 2 additions and 2 deletions

View File

@ -677,7 +677,7 @@ Model.nestRemoting = function(relationName, options, cb) {
try {
nestedFn.apply(inst, args);
} catch (err) {
cb(err);
cb && cb(err);
}
} else if (cb) {
cb(err, null);
@ -695,7 +695,7 @@ Model.nestRemoting = function(relationName, options, cb) {
try {
nestedFn.apply(inst, args);
} catch (err) {
cb(err);
cb && cb(err);
}
} else if (cb) {
cb(err, null);