Most appropriate sub-area of p5.js?
p5.js version
main
Web browser and version
Chrome (latest stable)
Operating system
Windows 11 (should be OS-independent)
Steps to reproduce this
Steps:
- Create any sketch.
- Call saveGif('test', 0) (or negative duration) in setup() or from a key handler.
- Check console.
snippet:
function setup() {
createCanvas(100, 100);
background(220);
circle(50, 50, 30);
// Repro: zero duration
saveGif('test', 0);
// also repros with negatives, e.g. saveGif('test', -1);
}
Console error:
TypeError: Cannot read properties of undefined (reading 'length')
Expected behavior
saveGif() should reject invalid duration early (e.g. duration must be > 0)
or gracefully handle zero captured frames without crashing.
Actual behavior
duration <= 0 leads to zero captured frames, then palette generation path assumes frames[0] exists and crashes.
Most appropriate sub-area of p5.js?
p5.js version
main
Web browser and version
Chrome (latest stable)
Operating system
Windows 11 (should be OS-independent)
Steps to reproduce this
Steps:
snippet:
Console error:
TypeError: Cannot read properties of undefined (reading 'length')Expected behavior
saveGif() should reject invalid duration early (e.g. duration must be > 0)
or gracefully handle zero captured frames without crashing.
Actual behavior
duration <= 0 leads to zero captured frames, then palette generation path assumes frames[0] exists and crashes.