Skip to content

Commit fa61817

Browse files
committed
Fix off-by-one error
1 parent b7b21b9 commit fa61817

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

utils/thumbnails.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -254,7 +254,7 @@ export const handler: Handler = async (event: any, context?: any) => {
254254
const min = meta2min.get(meta) || MIN;
255255
const max = meta2max.get(meta) || MAX;
256256
const random = randomInt(max, min);
257-
const realmove = Math.min(random, g.stack.length);
257+
const realmove = Math.min(random, g.stack.length - 1);
258258
g.load(realmove);
259259
const json = g.render({});
260260
allRecs.set(meta, JSON.stringify(json));

0 commit comments

Comments
 (0)