updated color setter validation to throw InvalidArgumentException instead of silently unsetting values

This commit is contained in:
Ivan Ganev 2017-11-07 11:07:33 +02:00
commit d13fa59759

View file

@ -12,6 +12,7 @@
namespace FFMpeg\Media;
use Alchemy\BinaryDriver\Exception\ExecutionFailureException;
use FFMpeg\Exception\InvalidArgumentException;
use FFMpeg\Filters\Waveform\WaveformFilterInterface;
use FFMpeg\Filters\Waveform\WaveformFilters;
use FFMpeg\Driver\FFMpegDriver;
@ -89,7 +90,9 @@ class Waveform extends AbstractMediaType
if (!preg_match('/^#(?:[0-9a-fA-F]{6})$/', $value))
{
//invalid color
unset($colors[$row]);
//unset($colors[$row]);
throw new InvalidArgumentException("The provided color '$value' is invalid");
}
}