lxn / walk

A Windows GUI toolkit for the Go Programming Language
Other
6.85k stars 885 forks source link

Examples - NotifyIcon/Webview are panicking while running #242

Open pnrgitter opened 7 years ago

pnrgitter commented 7 years ago

They get built succesfully though. Using Go 1.8 NotifyIcon:

panic: runtime error: invalid memory address or nil pointer dereference [signal 0xc0000005 code=0x0 addr=0x60 pc=0x50de5b]

goroutine 1 [running, locked to thread]: github.com/lxn/walk.(*FormBase).Run(0xc04206a000, 0x5acaec) C:/mygo/go/src/github.com/lxn/walk/form.go:232 +0x4b main.main() C:/mygo/go/src/github.com/lxn/walk/examples/notifyicon/notifyicon.go:79 +0x5c6

Webview:

panic: runtime error: invalid memory address or nil pointer dereference [signal 0xc0000005 code=0x0 addr=0x288 pc=0x52a4d8]

goroutine 1 [running, locked to thread]: github.com/lxn/walk.(*WebView).withWebBrowser2(0x0, 0xc04202b0a0, 0x0, 0x0) C:/mygo/go/src/github.com/lxn/walk/webview.go:220 +0x48

alexflint commented 7 years ago

It looks like the layout object is nil in the case of running the notify icon (perhaps because the window has no components in it?)

lxn commented 7 years ago

Both are recent regressions, I hope to push fixes tomorrow.

Sorry for the trouble :-(

Edit: Now that I have looked more closely at your WebView stack trace, I'm not sure about that one. Which Windows version and Go arch is this? WebView doesn't work too well on AMD64.

pnrgitter commented 7 years ago

Thanks, I'm still learning Go.. Otherwise, i would've contributed to fix it

lxn commented 7 years ago

No problem, thanks for reporting :-)

The notifyicon example should work again, will try to look at the other one soon.