diff options
author | obscuren <geffobscura@gmail.com> | 2014-05-31 17:34:37 +0800 |
---|---|---|
committer | obscuren <geffobscura@gmail.com> | 2014-05-31 17:34:37 +0800 |
commit | d6acb74ac95fc2630e5a1e2c71cc6534f135606b (patch) | |
tree | 5678cdb31123558360925ce017f1a85a662fb543 /ethereal | |
parent | 397e99fcc60a2d0acdc24971cd2d109e14f8f721 (diff) | |
download | dexon-d6acb74ac95fc2630e5a1e2c71cc6534f135606b.tar dexon-d6acb74ac95fc2630e5a1e2c71cc6534f135606b.tar.gz dexon-d6acb74ac95fc2630e5a1e2c71cc6534f135606b.tar.bz2 dexon-d6acb74ac95fc2630e5a1e2c71cc6534f135606b.tar.lz dexon-d6acb74ac95fc2630e5a1e2c71cc6534f135606b.tar.xz dexon-d6acb74ac95fc2630e5a1e2c71cc6534f135606b.tar.zst dexon-d6acb74ac95fc2630e5a1e2c71cc6534f135606b.zip |
fixed logging issue that would otherwise crash the client. Fixes #68
Diffstat (limited to 'ethereal')
-rw-r--r-- | ethereal/ui/gui.go | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/ethereal/ui/gui.go b/ethereal/ui/gui.go index b8245f47e..44215efdb 100644 --- a/ethereal/ui/gui.go +++ b/ethereal/ui/gui.go @@ -87,6 +87,8 @@ func (gui *Gui) Start(assetPath string) { win, err = gui.showKeyImport(context) } else { win, err = gui.showWallet(context) + + ethutil.Config.Log.AddLogSystem(gui) } if err != nil { ethutil.Config.Log.Infoln("FATAL: asset not found: you can set an alternative asset path on on the command line using option 'asset_path'") @@ -94,11 +96,9 @@ func (gui *Gui) Start(assetPath string) { panic(err) } - win.Show() - - ethutil.Config.Log.AddLogSystem(gui) ethutil.Config.Log.Infoln("[GUI] Starting GUI") + win.Show() win.Wait() gui.eth.Stop() @@ -174,9 +174,12 @@ var namereg = ethutil.FromHex("bb5f186604d057c1c5240ca2ae0f6430138ac010") func (gui *Gui) loadAddressBook() { gui.win.Root().Call("clearAddress") - gui.eth.StateManager().CurrentState().GetStateObject(namereg).State().EachStorage(func(name string, value *ethutil.Value) { - gui.win.Root().Call("addAddress", struct{ Name, Address string }{name, ethutil.Hex(value.Bytes())}) - }) + stateObject := gui.eth.StateManager().CurrentState().GetStateObject(namereg) + if stateObject != nil { + stateObject.State().EachStorage(func(name string, value *ethutil.Value) { + gui.win.Root().Call("addAddress", struct{ Name, Address string }{name, ethutil.Hex(value.Bytes())}) + }) + } } func (gui *Gui) readPreviousTransactions() { |