From 59db7ad44a23206369da08fe7f101b04e2c430bf Mon Sep 17 00:00:00 2001 From: EmmyHeart Date: Wed, 13 Dec 2023 05:56:40 +0000 Subject: [PATCH] Fixed a null condition when importing from Aqua --- titles/chuni/base.py | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/titles/chuni/base.py b/titles/chuni/base.py index 7272e54..43cad83 100644 --- a/titles/chuni/base.py +++ b/titles/chuni/base.py @@ -240,7 +240,6 @@ class ChuniBase: "isDumpUpload": "false", "isAou": "false", } - def handle_get_user_activity_api_request(self, data: Dict) -> Dict: user_activity_list = self.data.profile.get_profile_activity( data["userId"], data["kind"] @@ -873,9 +872,12 @@ class ChuniBase: if "userPlaylogList" in upsert: for playlog in upsert["userPlaylogList"]: # convert the player names to utf-8 - playlog["playedUserName1"] = self.read_wtf8(playlog["playedUserName1"]) - playlog["playedUserName2"] = self.read_wtf8(playlog["playedUserName2"]) - playlog["playedUserName3"] = self.read_wtf8(playlog["playedUserName3"]) + if playlog["playedUserName1"] is not None: + playlog["playedUserName1"] = self.read_wtf8(playlog["playedUserName1"]) + if playlog["playedUserName2"] is not None: + playlog["playedUserName2"] = self.read_wtf8(playlog["playedUserName2"]) + if playlog["playedUserName3"] is not None: + playlog["playedUserName3"] = self.read_wtf8(playlog["playedUserName3"]) self.data.score.put_playlog(user_id, playlog, self.version) if "userTeamPoint" in upsert: @@ -947,4 +949,4 @@ class ChuniBase: return { "userId": data["userId"], "userNetBattleData": {"recentNBSelectMusicList": []}, - } + } \ No newline at end of file