Skip to content

Commit 238badd

Browse files
committed
Fix null handling
1 parent 74b62f4 commit 238badd

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/Writer/PngWriter.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ public function write(QrCodeInterface $qrCode, ?LogoInterface $logo = null, ?Lab
2222
$options[self::WRITER_OPTION_COMPRESSION_LEVEL] = -1;
2323
}
2424

25-
if (!isset($options[self::WRITER_OPTION_NUMBER_OF_COLORS])) {
25+
if (!array_key_exists(self::WRITER_OPTION_NUMBER_OF_COLORS, $options)) {
2626
// When a logo is present use true color, otherwise use a palette of 16 colors
2727
$options[self::WRITER_OPTION_NUMBER_OF_COLORS] = $logo instanceof LogoInterface ? null : 16;
2828
}

0 commit comments

Comments
 (0)