Skip to content
This repository has been archived by the owner on Aug 19, 2024. It is now read-only.

Fix faulty null checks #8

Merged
merged 4 commits into from
Feb 12, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion dist/index.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/inpage.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "metamask-mobile-provider",
"version": "1.0.1",
"version": "1.0.2",
"main": "dist/index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1",
Expand Down
2 changes: 1 addition & 1 deletion src/content-script/inpage-bundle.js

Large diffs are not rendered by default.

7 changes: 2 additions & 5 deletions src/inpage/MobilePortStream.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,18 +38,15 @@ MobilePortStream.prototype._onMessage = function (event) {
if (this._origin !== '*' && event.origin !== this._origin) {
return
}
if (typeof msg !== 'object') {
if (!msg || typeof msg !== 'object') {
return
}
if (typeof msg.data !== 'object') {
if (!msg.data || typeof msg.data !== 'object') {
return
}
if (msg.target && msg.target !== this._name) {
return
}
if (!msg.data) {
return
}
// Filter outgoing messages
if (msg.data.data && msg.data.data.toNative) {
return
Expand Down
2 changes: 1 addition & 1 deletion src/inpage/ReactNativePostMessageStream.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ PostMessageStream.prototype._onMessage = function (event) {
if (event.source !== this._targetWindow && window === top) {
return
}
if (typeof msg !== 'object') {
if (!msg || typeof msg !== 'object') {
return
}
if (msg.target !== this._name) {
Expand Down