Skip to content

Commit

Permalink
Remove unecessary nested else statement
Browse files Browse the repository at this point in the history
  • Loading branch information
isaacgr committed Oct 10, 2020
1 parent 4adba26 commit 54cfdb2
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions src/server/protocol/base.js
Original file line number Diff line number Diff line change
Expand Up @@ -96,13 +96,11 @@ class JsonRpcServerProtocol {
const errorMessage = ERR_MSGS.invalidParams;
const id = message.id;
this._raiseError(errorMessage, code, id);
} else if (message.jsonrpc) {
if (this.version !== "2.0") {
const code = ERR_CODES.invalidRequest;
const errorMessage = ERR_MSGS.invalidRequest;
const id = message.id;
this._raiseError(errorMessage, code, id);
}
} else if (message.jsonrpc && this.version !== "2.0") {
const code = ERR_CODES.invalidRequest;
const errorMessage = ERR_MSGS.invalidRequest;
const id = message.id;
this._raiseError(errorMessage, code, id);
}
}

Expand Down

0 comments on commit 54cfdb2

Please sign in to comment.