diff options
| author | Malf Furious <m@lfurio.us> | 2018-09-20 00:28:17 -0400 |
|---|---|---|
| committer | Malf Furious <m@lfurio.us> | 2018-09-20 00:28:17 -0400 |
| commit | d16ddc164b82c594680359841eeeaa1e26aceaa1 (patch) | |
| tree | 77fc8fda9797c50e42d93703d4abb11e91104a7c /examples/example.html | |
| parent | 1daec62c0ab6590d3a30464b2f679baea3ca3936 (diff) | |
| download | scrott-d16ddc164b82c594680359841eeeaa1e26aceaa1.tar.gz scrott-d16ddc164b82c594680359841eeeaa1e26aceaa1.zip | |
pad: Fix bug in function getStages()
In cases where the pad had no stages beneath it, `new
stage($this->stage)` would construct an invalid object. As it turns
out, calling ->getArray() on an uninitialized stage object yeilds bad
results.
Instead of patching the stage::getArray() function, I add a check to
harden pad::getStages(). My reasoning for this is as follows: The bug
in getArray() manifests from a domain error, ie. it's only because we
are calling it on an uninitialized object. The object is already in a
bad state prior to caling getArray(). Rather, I opt to patch
getStages() so that we never create a bad object in the first place.
Now, for no-stage pads, getStages() will return early an empty array.
Diffstat (limited to '')
0 files changed, 0 insertions, 0 deletions
