fix(migration): use checked type assertion for background file id
This commit is contained in:
parent
fc5ab844de
commit
9d19a04550
|
|
@ -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 {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue