Skip to content

Database governance built for humans and agents — controlling changes and access across every major database.

early return if classification not found (#7416)

p0ny8119d7587245
diff --git a/backend/common/db_schema.go b/backend/common/db_schema.go
index 8e0fdc0a9f..fdaafdf062 100644
--- a/backend/common/db_schema.go
+++ b/backend/common/db_schema.go
@@ -10,6 +10,9 @@ var getClassificationFromCommentReg = regexp.MustCompile("^[0-9]+-[0-9]+-[0-9]+"
// GetClassificationAndUserComment parses classification and user comment from the given comment.
func GetClassificationAndUserComment(comment string) (string, string) {
classification := getClassificationFromCommentReg.FindString(comment)
+ if classification == "" {
+ return "", comment
+ }
userComment := strings.TrimPrefix(strings.TrimPrefix(comment, classification), "-")
return classification, userComment
}