We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 07fceef commit 6408c20Copy full SHA for 6408c20
lib/QrReader.php
@@ -91,7 +91,7 @@ public function text()
91
{
92
$this->decode();
93
94
- if (method_exists($this->result, 'toString')) {
+ if ($this->result && method_exists($this->result, 'toString')) {
95
return $this->result->toString();
96
}
97
tests/QrReaderTest.php
@@ -15,4 +15,11 @@ public function testText1()
15
$qrcode = new QrReader($image);
16
$this->assertSame("Hello world!", $qrcode->text());
17
18
+
19
+ public function testNoText()
20
+ {
21
+ $image = __DIR__ . "/qrcodes/empty.png";
22
+ $qrcode = new QrReader($image);
23
+ $this->assertSame(false, $qrcode->text());
24
+ }
25
tests/qrcodes/empty.png
1.56 KB
0 commit comments