Remove unneeded assertion check in handleSaveData

better-accounts
maru 2024-05-10 15:40:22 -04:00
parent 17294e5179
commit eea2266920
No known key found for this signature in database
GPG Key ID: 37689350E9CD0F0D
1 changed files with 3 additions and 8 deletions

View File

@ -296,20 +296,15 @@ func handleSaveData(w http.ResponseWriter, r *http.Request) {
break break
} }
s, ok := save.(defs.SessionSaveData)
if !ok {
err = fmt.Errorf("save data is not type SessionSaveData")
break
}
// doesn't return a save, but it works
var seed string var seed string
seed, err = db.GetDailyRunSeed() seed, err = db.GetDailyRunSeed()
if err != nil { if err != nil {
httpError(w, r, err, http.StatusInternalServerError) httpError(w, r, err, http.StatusInternalServerError)
return return
} }
save, err = savedata.Clear(uuid, slot, seed, s)
// doesn't return a save, but it works
save, err = savedata.Clear(uuid, slot, seed, save.(defs.SessionSaveData))
} }
if err != nil { if err != nil {
httpError(w, r, err, http.StatusInternalServerError) httpError(w, r, err, http.StatusInternalServerError)