mirror of
https://github.com/zitadel/zitadel.git
synced 2025-08-11 19:17:32 +00:00
fix: emit only if data and marshal invalid metadata
* fix(emitter): only emit if there are log records * fix(actions): marshal invalid metadata value into string
This commit is contained in:
@@ -22,6 +22,14 @@ func UserMetadataListFromQuery(c *actions.FieldConfig, metadata *query.UserMetad
|
||||
|
||||
for i, md := range metadata.Metadata {
|
||||
var value interface{}
|
||||
if !json.Valid(md.Value) {
|
||||
var err error
|
||||
md.Value, err = json.Marshal(string(md.Value))
|
||||
if err != nil {
|
||||
logging.WithError(err).Debug("unable to marshal unknow value")
|
||||
panic(err)
|
||||
}
|
||||
}
|
||||
err := json.Unmarshal(md.Value, &value)
|
||||
if err != nil {
|
||||
logging.WithError(err).Debug("unable to unmarshal into map")
|
||||
|
Reference in New Issue
Block a user