Skip to content

Commit

Permalink
Check if the result is a boolean
Browse files Browse the repository at this point in the history
  • Loading branch information
enricostara committed Aug 16, 2015
1 parent c1b1d43 commit f7d298c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/utility.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ function callService(service, emitter, channel, callback) {
emitter.once('error', reject);
emitter.once(eventName, function (result) {
emitter.removeListener('error', reject);
if (result.instanceOf('mtproto.type.Rpc_error')) {
if (typeof result !== 'boolean' && result.instanceOf('mtproto.type.Rpc_error')) {
reject(new Error(result.error_message));
} else {
fulfill(result);
Expand Down

0 comments on commit f7d298c

Please sign in to comment.