fix: nil-pointer error
This commit is contained in:
parent
61f6851e33
commit
cdd9ce1301
|
@ -61,7 +61,7 @@ func addScreenshotToGame(userGames []*models.Game, switchGame SwitchGame, screen
|
|||
}
|
||||
}
|
||||
|
||||
if foundGame.ID == "" {
|
||||
if foundGame == nil {
|
||||
foundGame := models.Game{Name: switchGame.Name, ID: switchGame.EncryptedGameID, Platform: platformName, Provider: platformName}
|
||||
foundGame.Screenshots = append(foundGame.Screenshots, screenshot)
|
||||
userGames = append(userGames, &foundGame)
|
||||
|
|
|
@ -11,7 +11,7 @@ func addScreenshotToGame(userGames []*models.Game, gameName string, screenshot m
|
|||
}
|
||||
}
|
||||
|
||||
if foundGame.ID == "" {
|
||||
if foundGame == nil {
|
||||
foundGame := models.Game{Name: gameName, ID: gameName, Platform: platformName, Provider: platformName}
|
||||
foundGame.Screenshots = append(foundGame.Screenshots, screenshot)
|
||||
userGames = append(userGames, &foundGame)
|
||||
|
|
Loading…
Reference in New Issue