Skip to content
Snippets Groups Projects
Commit 999eb833 authored by Gabriel Zachmann's avatar Gabriel Zachmann
Browse files

fix get enabled grants bug if no grants yet enabled

parent bb636cca
No related branches found
No related tags found
No related merge requests found
......@@ -70,6 +70,7 @@ func GrantEnabled(rlog log.Ext1FieldLogger, tx *sqlx.Tx, myID mtid.MTID, grantTy
return errors.WithStack(tx.Get(&enabled, `CALL Grants_CheckEnabled(?,?)`, myID, grantType.String()))
},
); err != nil {
_, err = db.ParseError(err) // if no rows found, that's not an error, but grant is not enabled
return false, err
}
return bool(enabled), nil
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment