updated color setter validation to throw InvalidArgumentException instead of silently unsetting values
This commit is contained in:
parent
607df6aa79
commit
d13fa59759
1 changed files with 4 additions and 1 deletions
|
|
@ -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");
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue