Skip to content

Commit

Permalink
fix: log error when parse empty tag, should not parse empty tag
Browse files Browse the repository at this point in the history
  • Loading branch information
winfredLIN committed Nov 27, 2023
1 parent 370c7af commit 4966c31
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions sqle/api/controller/v1/sql_audit_record.go
Original file line number Diff line number Diff line change
Expand Up @@ -610,8 +610,10 @@ func GetSQLAuditRecordsV1(c echo.Context) error {
status = SQLAuditRecordStatusSuccessfully
}
var tags []string
if err := json.Unmarshal([]byte(record.Tags.String), &tags); err != nil {
log.NewEntry().Errorf("parse tags failed,tags:%v , err: %v", record.Tags, err)
if record.Tags.Valid {
if err := json.Unmarshal([]byte(record.Tags.String), &tags); err != nil {
log.NewEntry().Errorf("parse tags failed,tags:%v , err: %v", record.Tags, err)
}
}
resData[i] = SQLAuditRecord{
Creator: record.CreatorName,
Expand Down

0 comments on commit 4966c31

Please sign in to comment.