From 51ebea1f687d517f1aa555ac269ffc6d1e3763ec Mon Sep 17 00:00:00 2001 From: Brian Chirls Date: Thu, 29 Oct 2015 16:20:45 -0400 Subject: [PATCH] Fix: Channels effect crashes when setting alphaSource when source is undefined (#109) --- effects/seriously.channels.js | 5 +++ test/media/tiny.png | Bin 0 -> 169 bytes test/seriously.unit.js | 64 ++++++++++++++++++++++++++++++++++ 3 files changed, 69 insertions(+) create mode 100644 test/media/tiny.png diff --git a/effects/seriously.channels.js b/effects/seriously.channels.js index ca9d52f..6dd1e24 100644 --- a/effects/seriously.channels.js +++ b/effects/seriously.channels.js @@ -95,6 +95,11 @@ s = inputs[name]; if (!s) { s = me.sources[name] = inputs[name] = inputs.source; + + if (!s) { + //no main source to fall back to + return; + } } j = sources.indexOf(s); diff --git a/test/media/tiny.png b/test/media/tiny.png new file mode 100644 index 0000000000000000000000000000000000000000..b5daf2370284e065b88aa796bcbfd4a35cb86bc5 GIT binary patch literal 169 zcmeAS@N?(olHy`uVBq!ia0vp^4j|0I1SD0tpLGH$&H|6fVj#^3#{Q~Dt^pa*o-U3d z6?5L6-^j_JAi%OA+LiktCu?a%`i38R6IdtB4qcTxy{iE$I8go|Wy-6WOIfgkeYUS> WzUX-U+cyhn4TGnvpUXO@geCxTG%