endroid / qr-code

QR Code Generator
https://endroid.nl
MIT License
4.33k stars 721 forks source link

There is problem in line 41 in qrcode #412

Closed AbrahamBanzuela closed 1 year ago

AbrahamBanzuela commented 1 year ago

Fatal error: Uncaught TypeError: Endroid\QrCode\QrCode::create(): Argument #1 ($data) must be of type string, null given, called in C:\xampp\htdocs\attend\generate.php on line 10 and defined in C:\xampp\htdocs\attend\vendor\endroid\qr-code\src\QrCode.php:41 Stack trace: #0 C:\xampp\htdocs\attend\generate.php(10): Endroid\QrCode\QrCode::create(NULL) #1 {main} thrown in C:\xampp\htdocs\attend\vendor\endroid\qr-code\src\QrCode.php on line 41

endroid commented 1 year ago

Hi @AbrahamBanzuela this is not an error in the library. The $data parameter should indeed be a string, see https://github.com/endroid/qr-code/blob/013f6c3d22d046d48d9a0d21f1ce8ef18ce1b625/src/QrCode.php#L41 so you should investigate where the $data is coming from and why it is null.. Good luck!