mirror of
https://github.com/fazo96/ipfs-boards
synced 2025-03-12 21:48:39 +01:00
fix bug when opt is null
This commit is contained in:
parent
f132d5ae43
commit
6ef1e7d3e0
@ -12,8 +12,9 @@ var opt, s = localStorage.getItem('ipfs-boards-settings')
|
|||||||
try {
|
try {
|
||||||
opt = JSON.parse(s)
|
opt = JSON.parse(s)
|
||||||
} catch(e){
|
} catch(e){
|
||||||
opt = { addr: 'localhost', port: 5001 }
|
// Do nothing
|
||||||
}
|
}
|
||||||
|
if(opt === null || opt === undefined) opt = { addr: 'localhost', port: 5001 }
|
||||||
var ipfs = require('ipfs-api')(opt.addr || 'localhost',opt.port || 5001)
|
var ipfs = require('ipfs-api')(opt.addr || 'localhost',opt.port || 5001)
|
||||||
var boards = new BoardsAPI(ipfs)
|
var boards = new BoardsAPI(ipfs)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user