Skip to content
Snippets Groups Projects
Commit 00d4e0a7 authored by jkito's avatar jkito :skull: Committed by jkito
Browse files

fix crash during start when helper not installed

during initialization setting ctx.bitmask as soon as vpn.Init()
returns and by not returning error from launcher.FirewallStop
this works around the issue where the app crashes because of calling
methods of the Bitmask object which was nil

the launcher.FirewallStop method returned an error when the helper
was not installed
parent aedb5003
Branches
Tags
1 merge request!273fix crash during start when helper not installed
......@@ -74,9 +74,10 @@ func initializeBitmask(errCh chan string, opts *InitOpts) {
Err(err).
Msg("Could not initialize bitmask")
errCh <- err.Error()
return
}
ctx.bm = b
// right now we just get autostart from an init flag,
// but we want to be able to persist that option from the preferences
// pane
......@@ -99,7 +100,6 @@ func initializeBitmask(errCh chan string, opts *InitOpts) {
log.Error().Msg("Could not find polkit")
errCh <- "nopolkit"
}
ctx.bm = b
ctx.IsReady = true
}
......
......@@ -119,8 +119,7 @@ func Init() (*Bitmask, error) {
Str("caCertPath", b.getTempCaCertPath()).
Msg("Sucessfully wrote OpenVPN CA certificate (hardcoded in the binary, not coming from API)")
err = b.launch.FirewallStop()
if err != nil {
if err := b.launch.FirewallStop(); err != nil {
log.Warn().
Err(err).
Msg("Could not stop firewall")
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment