1
0
mirror of synced 2024-11-27 15:40:48 +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)
else:
# We will want to fetch the remaining scores that were in our
# cache.
scores = self.cache.get(cache_key)
# cache. If the cache is empty, due to some error, or because
# 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:
# We simply return the whole amount for this, and cache nothing.