fix: Do not return err if m.Notifications is nil (#2781)
fix: Do not return err if m.Notifications is nil (#2781)

* fix: Do not return err if m.Notifications is nil

Since err can be nil when m.Notifications is nil, we're not sending
any error at the end in that case. We returned a 201 OK whereas we're
not creating anything.

Later in the code, we check if m.Notifications[p.category] exists. If
not we are returning an error. Let's use this error.

* fixup! fix: Do not return err if m.Notifications is nil

Co-authored-by: Bruno Michel <e1dbe13121b702e092f56ea5f859eea2857a35c8@menfin.info>
nono/cozy-stack,nono/cozy-stack,nono/cozy-stack,nono/cozy-stack,nono/cozy-stack