diff --git a/js/rbx/Preview.js b/js/rbx/Preview.js index c5b9961f..4c3b7e01 100644 --- a/js/rbx/Preview.js +++ b/js/rbx/Preview.js @@ -41,8 +41,10 @@ function getOutfitData(id) { } function getPlayerAppearance(userId) { - if(!outfitCache["user" + userId]) { - return outfitCache["user" + userId] = RobloxApi.avatar.getUserAvatar(userId).then(data => { + let avatarKey = (!userId || userId <= 0) ? "default" : "user" + userId + + if(!outfitCache[avatarKey]) { + return outfitCache[avatarKey] = (avatarKey == "default" ? RobloxApi.avatar.getCurrentAvatar() : RobloxApi.avatar.getUserAvatar(userId)).then(data => { data = { ...data } data.bodyColors = solveBodyColors(data.bodyColor3s) @@ -52,7 +54,7 @@ function getPlayerAppearance(userId) { }) } - return outfitCache["user" + userId] + return outfitCache[avatarKey] } function getCurrentAppearance() { @@ -1294,4 +1296,4 @@ const HoverPreview = (() => { }) } } -})() \ No newline at end of file +})()