1
0
Fork 0
mirror of https://github.com/documize/community.git synced 2025-07-25 16:19:46 +02:00

Clean up category code/formatting for MySQL store

This commit is contained in:
McMatts 2018-04-04 14:38:41 +01:00
parent 01720722d6
commit 274b77cb8f

View file

@ -219,7 +219,8 @@ func (s Scope) GetDocumentCategoryMembership(ctx domain.RequestContext, document
SELECT id, refid, orgid, labelid, category, created, revised FROM category
WHERE orgid=? AND refid IN (SELECT categoryid FROM categorymember WHERE orgid=? AND documentid=?)`, ctx.OrgID, ctx.OrgID, documentID)
if err == sql.ErrNoRows {
if err == sql.ErrNoRows || len(c) == 0 {
c = []category.Category{}
err = nil
}
if err != nil {