From 94becce830cf6cd72475e15a9007433487d8960f Mon Sep 17 00:00:00 2001 From: smiley Date: Tue, 13 Jun 2023 17:21:02 +0200 Subject: [PATCH] :octocat: --- src/Output/QROutputAbstract.php | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/Output/QROutputAbstract.php b/src/Output/QROutputAbstract.php index 3146f69b9..50cff7caf 100644 --- a/src/Output/QROutputAbstract.php +++ b/src/Output/QROutputAbstract.php @@ -94,10 +94,17 @@ abstract class QROutputAbstract implements QROutputInterface{ /** * Returns the prepared value for the given $M_TYPE * - * @return mixed|null return value depends on the output class + * @return mixed|null return value depends on the output class, null if $moduleValues[$M_TYPE] doesn't exist + * @throws \chillerlan\QRCode\Output\QRCodeOutputException */ protected function getModuleValue(int $M_TYPE){ - return ($this->moduleValues[$M_TYPE] ?? null); + + if(!isset($this->moduleValues[$M_TYPE])){ + return null; +# throw new QRCodeOutputException(sprintf('invalid M_TYPE: %024b', $M_TYPE)); + } + + return $this->moduleValues[$M_TYPE]; } /**