1
0
mirror of synced 2024-11-24 06:20:12 +01:00

Fix for cache-based crash on second mdata when caching is wonky.

This commit is contained in:
Jennifer Taylor 2024-09-18 02:50:09 +00:00
parent 776ed8cc78
commit 253dd52b67

View File

@ -176,8 +176,11 @@ class JubeatBase(CoreHandler, CardManagerHandler, PASELIHandler, Base):
scores = self.data.remote.music.get_scores(self.game, self.music_version, userid) scores = self.data.remote.music.get_scores(self.game, self.music_version, userid)
else: else:
# We will want to fetch the remaining scores that were in our # We will want to fetch the remaining scores that were in our
# cache. # cache. If the cache is empty, due to some error, or because
scores = self.cache.get(cache_key) # we cached nothing below, then we will end up returning an
# empty list. This shouldn't happen, but guard against crashing
# if this returns None anyway.
scores = self.cache.get(cache_key) or []
if len(scores) < 50: if len(scores) < 50:
# We simply return the whole amount for this, and cache nothing. # We simply return the whole amount for this, and cache nothing.