From 6ef1e7d3e0c2c6395b5f500a74af33e571598ffa Mon Sep 17 00:00:00 2001 From: Enrico Fasoli Date: Wed, 18 Nov 2015 01:55:31 +0100 Subject: [PATCH] fix bug when opt is null --- webapp/app.jsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/webapp/app.jsx b/webapp/app.jsx index bcee0b8..7dd6704 100644 --- a/webapp/app.jsx +++ b/webapp/app.jsx @@ -12,8 +12,9 @@ var opt, s = localStorage.getItem('ipfs-boards-settings') try { opt = JSON.parse(s) } 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 boards = new BoardsAPI(ipfs)