Skip to content
This repository was archived by the owner on Mar 5, 2025. It is now read-only.

Commit 44a3030

Browse files
dafflfrozeman
authored andcommitted
Stop JSON RPC errors from breaking websocket provider onmessage logic (#1856)
1 parent f427400 commit 44a3030

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

packages/web3-providers-ws/src/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ var WebsocketProvider = function WebsocketProvider(url, options) {
110110
}
111111

112112
// notification
113-
if(!id && result.method.indexOf('_subscription') !== -1) {
113+
if(!id && result && result.method && result.method.indexOf('_subscription') !== -1) {
114114
_this.notificationCallbacks.forEach(function(callback){
115115
if(_.isFunction(callback))
116116
callback(result);

0 commit comments

Comments
 (0)