From 262685f91187245e6c697bd8aa52b4939ff9adf9 Mon Sep 17 00:00:00 2001 From: Yathartha Goenka Date: Mon, 30 Jan 2023 20:08:37 +0530 Subject: [PATCH] Added check for options type while creating network --- lib/protocol/network.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/protocol/network.js b/lib/protocol/network.js index 62e8fdb8c..265c1aac3 100644 --- a/lib/protocol/network.js +++ b/lib/protocol/network.js @@ -132,6 +132,9 @@ class Network { if (typeof options === 'string') options = networks[options]; + if (options instanceof Object) + assert(!options.type, 'Unknown network.'); + assert(options, 'Unknown network.'); if (Network[options.type])