Fix crash caused by last fix dammit (fixes #9)
This commit is contained in:
parent
d03d61516f
commit
8c2f71294f
@ -1785,7 +1785,7 @@ class Conductor {
|
|||||||
if (identifier !== null) {
|
if (identifier !== null) {
|
||||||
// TODO again, enforce something about the shape here
|
// TODO again, enforce something about the shape here
|
||||||
this.current_pack_savefile = JSON.parse(window.localStorage.getItem(STORAGE_PACK_PREFIX + identifier));
|
this.current_pack_savefile = JSON.parse(window.localStorage.getItem(STORAGE_PACK_PREFIX + identifier));
|
||||||
if (this.current_pack_savefile.total_score === null) {
|
if (this.current_pack_savefile && this.current_pack_savefile.total_score === null) {
|
||||||
// Fix some NaNs that slipped in
|
// Fix some NaNs that slipped in
|
||||||
this.current_pack_savefile.total_score = this.current_pack_savefile.scorecards
|
this.current_pack_savefile.total_score = this.current_pack_savefile.scorecards
|
||||||
.map(scorecard => scorecard ? scorecard.score : 0)
|
.map(scorecard => scorecard ? scorecard.score : 0)
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user