fix(migration): use checked type assertion for background file id

This commit is contained in:
kolaente 2026-02-24 20:37:33 +01:00
parent fc5ab844de
commit 9d19a04550
1 changed files with 5 additions and 1 deletions

View File

@ -242,7 +242,11 @@ func addDetailsToProject(l *models.ProjectWithTasksAndBuckets, storedFiles map[i
if is { if is {
bgid, has := bginfo["id"] bgid, has := bginfo["id"]
if has { if has {
backgroundFileID = int64(bgid.(float64)) bgidFloat, ok := bgid.(float64)
if !ok {
return fmt.Errorf("invalid background file id type: expected number, got %T", bgid)
}
backgroundFileID = int64(bgidFloat)
} }
} }
if b, exists := storedFiles[backgroundFileID]; exists { if b, exists := storedFiles[backgroundFileID]; exists {