Skip to content

Commit

Permalink
Check if the bitmap file exists or not
Browse files Browse the repository at this point in the history
  • Loading branch information
adeas31 committed Mar 21, 2019
1 parent df3d8f4 commit e76522f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions OMEdit/OMEditGUI/Annotations/BitmapAnnotation.cpp
Expand Up @@ -102,7 +102,7 @@ BitmapAnnotation::BitmapAnnotation(QString classFileName, GraphicsView *pGraphic
setShapeFlags(true);

setFileName(mClassFileName);
if (!mFileName.isEmpty()) {
if (!mFileName.isEmpty() && QFile::exists(mFileName)) {
mImage.load(mFileName);
} else {
mImage = QImage(":/Resources/icons/bitmap-shape.svg");
Expand Down Expand Up @@ -132,7 +132,7 @@ void BitmapAnnotation::parseShapeAnnotation(QString annotation)
}
if (!mImageSource.isEmpty()) {
mImage.loadFromData(QByteArray::fromBase64(mImageSource.toLatin1()));
} else if (!mFileName.isEmpty()) {
} else if (!mFileName.isEmpty() && QFile::exists(mFileName)) {
mImage.load(mFileName);
} else {
mImage = QImage(":/Resources/icons/bitmap-shape.svg");
Expand Down

0 comments on commit e76522f

Please sign in to comment.