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
charlotte ✨ 7 months ago e29f103c affaa58b
··· 14 14 15 15 var prefs map[string]any 16 16 err := json.Unmarshal(repo.Preferences, &prefs) 17 17 - if err != nil { 17 17 + if err != nil || prefs == nil { 18 18 prefs = map[string]any{ 19 19 "preferences": map[string]any{}, 20 20 }