diff --git a/lib/web/userpreferences.go b/lib/web/userpreferences.go index 43a8d76d9bd50..865d66394516e 100644 --- a/lib/web/userpreferences.go +++ b/lib/web/userpreferences.go @@ -244,6 +244,12 @@ func onboardUserPreferencesResponse(resp *userpreferencesv1.OnboardUserPreferenc // accessGraphPreferencesResponse creates a JSON response for the access graph preferences. func accessGraphPreferencesResponse(resp *userpreferencesv1.AccessGraphUserPreferences) AccessGraphPreferencesResponse { + if resp == nil { + return AccessGraphPreferencesResponse{ + HasBeenRedirected: false, + } + } + return AccessGraphPreferencesResponse{ HasBeenRedirected: resp.HasBeenRedirected, }