delegation,invocation: meta can be nil in the model, but not in the view
This commit is contained in:
@@ -214,6 +214,9 @@ func tokenFromModel(m tokenPayloadModel) (*Token, error) {
|
||||
tkn.nonce = m.Nonce
|
||||
|
||||
tkn.meta = m.Meta
|
||||
if tkn.meta == nil {
|
||||
tkn.meta = meta.NewMeta()
|
||||
}
|
||||
|
||||
tkn.notBefore, err = parse.OptionalTimestamp(m.Nbf)
|
||||
if err != nil {
|
||||
|
||||
@@ -277,7 +277,11 @@ func tokenFromModel(m tokenPayloadModel) (*Token, error) {
|
||||
}
|
||||
|
||||
tkn.proof = m.Prf
|
||||
|
||||
tkn.meta = m.Meta
|
||||
if tkn.meta == nil {
|
||||
tkn.meta = meta.NewMeta()
|
||||
}
|
||||
|
||||
tkn.expiration, err = parse.OptionalTimestamp(m.Exp)
|
||||
if err != nil {
|
||||
|
||||
Reference in New Issue
Block a user