Skip to content

Commit 0a0dd61

Browse files
authored
Fix screenshot download not working when there is no location data (#765)
1 parent 55a6b06 commit 0a0dd61

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

screenshots.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -279,7 +279,7 @@ async function downloadScreenshot(url, date, screenshotData, resized) {
279279
const [month, day, year, hour, minute, second] = [date.getMonth(), date.getDate(), date.getFullYear(), date.getHours(), date.getMinutes(), date.getSeconds()];
280280
const formattedDate = `${year}-${(month + 1).toString().padStart(2, '0')}-${day.toString().padStart(2, '0')}-${hour.toString().padStart(2, '0')}h${minute.toString().padStart(2, '0')}m${second.toString().padStart(2, '0')}s`;
281281
const game = screenshotData?.game || ynoGameId;
282-
let mapName = gameLocalizedMapLocations[game][screenshotData?.mapId];
282+
let mapName = (gameLocalizedMapLocations[game] ?? {})[screenshotData?.mapId];
283283
if (!mapName && game === '2kki' && screenshotData?.mapId)
284284
if (screenshotData.game) // if game is set (non-local screenshot) it's incorrect to use the cached 2kki values.
285285
mapName = await new Promise(resolve => getOrQuery2kkiLocations(screenshotData.mapId, null, null, resolve));

0 commit comments

Comments
 (0)