Skip to content

Commit

Permalink
fix: do not fail outside the browser
Browse files Browse the repository at this point in the history
  • Loading branch information
fsdiogo committed Jun 14, 2019
1 parent 3a6adc0 commit 2714381
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/providers/ipfs-http-api.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ async function tryApi ({ IpfsApi, apiAddress, defaultApiAddress, location, ipfsC
}

// Current origin is not localhost:5001 so try with current origin info
if (location.port !== '5001' || !location.hostname.match(/^127.0.0.1$|^localhost$/)) {
if (location && (location.port !== '5001' || !location.hostname.match(/^127.0.0.1$|^localhost$/))) {
let originAddress = null

try {
Expand Down

0 comments on commit 2714381

Please sign in to comment.