mirror of
https://gitee.com/vnotex/vnote.git
synced 2025-07-05 13:59:52 +08:00
bug-fix: may download NULL image
This commit is contained in:
parent
9f9cc553dd
commit
37c692b090
@ -1,6 +1,7 @@
|
||||
#include <QtWidgets>
|
||||
#include <QValidator>
|
||||
#include <QRegExp>
|
||||
#include <QDebug>
|
||||
#include "vinsertimagedialog.h"
|
||||
#include "utils/vutils.h"
|
||||
#include "vlineedit.h"
|
||||
@ -126,7 +127,11 @@ void VInsertImageDialog::handleBrowseBtnClicked()
|
||||
|
||||
void VInsertImageDialog::setImage(const QImage &image)
|
||||
{
|
||||
Q_ASSERT(!image.isNull());
|
||||
if (image.isNull()) {
|
||||
qWarning() << "set Null image";
|
||||
return;
|
||||
}
|
||||
|
||||
int width = 512 * VUtils::calculateScaleFactor();
|
||||
QSize previewSize(width, width);
|
||||
if (!this->image) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user