diff options
| author | Jeff Garzik <[email protected]> | 2012-04-15 08:31:22 -0700 |
|---|---|---|
| committer | Jeff Garzik <[email protected]> | 2012-04-15 08:31:22 -0700 |
| commit | c99ddfaa22abd23781c81819d851df8e866b6725 (patch) | |
| tree | 9123ad1d65482c9a525d76f17739ebd671ddcffc /src | |
| parent | Rename make_windows_icon.py to .sh as it is a shell script (fixes #1099) (diff) | |
| parent | Bugfix: Check that QRcode_encodeString didn't return NULL (error) (diff) | |
| download | discoin-c99ddfaa22abd23781c81819d851df8e866b6725.tar.xz discoin-c99ddfaa22abd23781c81819d851df8e866b6725.zip | |
Merge pull request #1100 from luke-jr/qrcode_errchk
Bugfix: Check that QRcode_encodeString didn't return NULL (error)
Diffstat (limited to 'src')
| -rw-r--r-- | src/qt/qrcodedialog.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/qt/qrcodedialog.cpp b/src/qt/qrcodedialog.cpp index 9965f1438..2a428fb79 100644 --- a/src/qt/qrcodedialog.cpp +++ b/src/qt/qrcodedialog.cpp @@ -41,6 +41,11 @@ void QRCodeDialog::genCode() ui->lblQRCode->setText(""); QRcode *code = QRcode_encodeString(uri.toUtf8().constData(), 0, QR_ECLEVEL_L, QR_MODE_8, 1); + if (!code) + { + ui->lblQRCode->setText(tr("Error encoding URI into QR Code.")); + return; + } myImage = QImage(code->width + 8, code->width + 8, QImage::Format_RGB32); myImage.fill(0xffffff); unsigned char *p = code->data; |