diff --git a/src/QRCode.php b/src/QRCode.php index 851c43e02..c56d436c4 100644 --- a/src/QRCode.php +++ b/src/QRCode.php @@ -105,14 +105,14 @@ class QRCode{ public function setData($data, QROptions $options = null){ $data = trim($data); - if(!$options instanceof QROptions){ - $options = new QROptions; - } - if(empty($data)){ throw new QRCodeException('No data given.'); } + if(!$options instanceof QROptions){ + $options = new QROptions; + } + if(!array_key_exists($options->errorCorrectLevel, QRConst::RSBLOCK)){ throw new QRCodeException('Invalid error correct level: '.$options->errorCorrectLevel); }