Fix panic during restarting the bridge

This commit is contained in:
Michal Horejsek
2020-12-10 13:09:45 +01:00
parent 9d576beeb8
commit 79465571d7
2 changed files with 9 additions and 1 deletions

View File

@ -208,7 +208,11 @@ func (s *FrontendQt) watchEvents() {
s.Qml.ShowWindow()
case <-restartBridgeCh:
s.Qml.SetIsRestarting(true)
s.App.Quit()
// watchEvents is started in parallel with the Qt app.
// If the event comes too early, app doesn't have to be ready yet.
if s.App != nil {
s.App.Quit()
}
case address := <-addressChangedCh:
s.Qml.NotifyAddressChanged(address)
case address := <-addressChangedLogoutCh: