forked from hailey.at/cocoon
An atproto PDS written in Go

if prefs are null in db, don't return {} on getPrefs (#8)

currently if you haven't putPreferences at all you break social-app,
since it expects response.preferences to always be present

authored by charlotte ✨ and committed by GitHub e29f103c affaa58b

Changed files
+1 -1
server
+1 -1
server/handle_actor_get_preferences.go
··· 14 15 var prefs map[string]any 16 err := json.Unmarshal(repo.Preferences, &prefs) 17 - if err != nil { 18 prefs = map[string]any{ 19 "preferences": map[string]any{}, 20 }
··· 14 15 var prefs map[string]any 16 err := json.Unmarshal(repo.Preferences, &prefs) 17 + if err != nil || prefs == nil { 18 prefs = map[string]any{ 19 "preferences": map[string]any{}, 20 }