Skip to content

Commit 3d9ca8d

Browse files
authored
Typecheck online friends
Should fix #2048
1 parent 0e0171b commit 3d9ca8d

File tree

1 file changed

+12
-10
lines changed

1 file changed

+12
-10
lines changed

MainModule/Client/UI/Default/Profile.luau

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -207,15 +207,17 @@ return function(data, env)
207207
local friendCount = 0
208208
local onlineCount = 0
209209

210-
for _, user in data.OnlineFriends do
211-
onlineFriends[user.VisitorId] = {
212-
lastOnline = DateTime.fromIsoDate(user.LastOnline),
213-
isOnline = user.IsOnline,
214-
lastLocation = user.LastLocation,
215-
placeId = user.PlaceId,
216-
jobId = user.GameId,
217-
locationType = LOCATION_TYPE[user.LocationType and user.LocationType + 1]
218-
}
210+
if type(data.OnlineFriends) == "table" then
211+
for _, user in pairs(data.OnlineFriends) do
212+
onlineFriends[user.VisitorId] = {
213+
lastOnline = DateTime.fromIsoDate(user.LastOnline),
214+
isOnline = user.IsOnline,
215+
lastLocation = user.LastLocation,
216+
placeId = user.PlaceId,
217+
jobId = user.GameId,
218+
locationType = LOCATION_TYPE[user.LocationType and user.LocationType + 1]
219+
}
220+
end
219221
end
220222

221223
Routine(function()
@@ -478,4 +480,4 @@ return function(data, env)
478480
else
479481
gametab:Disable()
480482
end
481-
end
483+
end

0 commit comments

Comments
 (0)