Skip to content

Commit

Permalink
Added check for options type while creating network
Browse files Browse the repository at this point in the history
  • Loading branch information
yatharthagoenka committed Jan 30, 2023
1 parent 57f5956 commit 38f879b
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions lib/protocol/network.js
Original file line number Diff line number Diff line change
Expand Up @@ -131,9 +131,12 @@ class Network {
static create(options) {
if (typeof options === 'string')
options = networks[options];


if(options instanceof Object)
assert(!options.type, 'Unknown network.');

assert(options, 'Unknown network.');

if (Network[options.type])
return Network[options.type];

Expand Down

0 comments on commit 38f879b

Please sign in to comment.