Files
firezone/swift
Jamil 1ddc2f5de6 fix(apple): Don't crash if tunnel manager session is unexpectedly nil (#7594)
In certain weird edge cases such as:

- The user removes the VPN profile while Firezone is signed in, causing
the `NETunnelProviderSession` to go invalid immediately
- The user approves the system extension to load before the VPN profile
access is granted

then the TunnelManager will not be able to obtain a valid reference to a
NETunnelProviderSession object.

In these cases, for now, it makes more sense to fail silently than to
crash, effectively making these operations a no-op until the user
remedies the VPN profile. Currently the user is prompted to re-grant VPN
profile whenever its status goes to `invalid`, so these cases don't
technically fail without prompting the user.

Draft because it's stacked on #7593 


Fixes #7579 
Fixes #7591

---------

Signed-off-by: Jamil <jamilbk@users.noreply.github.com>
Co-authored-by: Thomas Eizinger <thomas@eizinger.io>
2024-12-30 20:14:56 +00:00
..