Skip to content

Commit

Permalink
Handle access graph preferences being nil (#40413)
Browse files Browse the repository at this point in the history
  • Loading branch information
ryanclark authored Apr 10, 2024
1 parent 7e9ff5a commit 3c26f17
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions lib/web/userpreferences.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
}
Expand Down

0 comments on commit 3c26f17

Please sign in to comment.