Skip to content

Commit 39360d8

Browse files
committed
refactor(alerts): update ParentId initialization to handle nullable values
1 parent de47895 commit 39360d8

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

plugins/alerts/main.go

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -335,7 +335,12 @@ func newAlert(alert *plugins.Alert, parentId *string) error {
335335
}
336336

337337
a.Id = alert.Id
338-
a.ParentId = alert.ParentId
338+
a.ParentId = func() string {
339+
if parentId != nil {
340+
return *parentId
341+
}
342+
return ""
343+
}()
339344
a.Name = alert.Name
340345
a.Category = alert.Category
341346
a.Description = alert.Description

0 commit comments

Comments
 (0)