mirror of
https://github.com/wailsapp/wails.git
synced 2026-03-14 22:55:48 +01:00
Prevent app crashing when calling systray.Run() before app.Run() (#4826)
This commit is contained in:
parent
0271c9e10c
commit
9174be76f2
2 changed files with 8 additions and 0 deletions
|
|
@ -23,6 +23,7 @@ After processing, the content will be moved to the main changelog and this file
|
|||
|
||||
## Fixed
|
||||
<!-- Bug fixes -->
|
||||
- Prevent app crashing when calling systray.Run() before app.Run() by @leaanthony
|
||||
|
||||
## Deprecated
|
||||
<!-- Soon-to-be removed features -->
|
||||
|
|
|
|||
|
|
@ -96,6 +96,13 @@ func (s *SystemTray) Label() string {
|
|||
}
|
||||
|
||||
func (s *SystemTray) Run() {
|
||||
|
||||
// exit early if application isn't running.
|
||||
// app.Run() will call this
|
||||
if globalApplication == nil || globalApplication.running == false {
|
||||
return
|
||||
}
|
||||
|
||||
s.impl = newSystemTrayImpl(s)
|
||||
|
||||
if s.attachedWindow.Window != nil {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue