Cannot use object of type Zxing\Qrcode\Decoder\ECBlocks as array
EasonJolter opened this issue · comments
this image couse Cannot use object of type Zxing\Qrcode\Decoder\ECBlocks as array
ThrowableError in Version.php line 96
public function getECBlocksForLevel($ecLevel) { return $this->ecBlocks[$ecLevel->getOrdinal()]; }
I use try catch, but it dosn't catched, just throw exception.
And why this image couse exception?
You have to change the following line in Version.php (94 - 101):
public function getECBlocksForLevel($ecLevel) { return $this->ecBlocks[$ecLevel->getOrdinal()]; }
to:
public function getECBlocksForLevel($ecLevel) { if(is_array($this->ecBlocks)){ return $this->ecBlocks[$ecLevel->getOrdinal()]; }else{ return $this->ecBlocks; } }