Skip to content

Commit

Permalink
Check if image handler exists before replacing image.
Browse files Browse the repository at this point in the history
  • Loading branch information
MaurycyLiebner committed Jan 6, 2022
1 parent 57cf06d commit e88e48f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/core/FileCacheHandlers/imagecachehandler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -89,11 +89,11 @@ void ImageLoader::process() {
}

void ImageLoader::afterProcessing() {
mTargetHandler->replaceImage(mImage);
if(mTargetHandler) mTargetHandler->replaceImage(mImage);
}

void ImageLoader::afterCanceled() {
mTargetHandler->replaceImage(mImage);
if(mTargetHandler) mTargetHandler->replaceImage(mImage);
}

void OraLoader::process() {
Expand Down
2 changes: 1 addition & 1 deletion src/core/FileCacheHandlers/imagecachehandler.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ class CORE_EXPORT ImageLoader : public eHddTask {
void afterProcessing();
void afterCanceled();
protected:
ImageFileDataHandler * const mTargetHandler;
const qptr<ImageFileDataHandler> mTargetHandler;
const QString mFilePath;
sk_sp<SkImage> mImage;
};
Expand Down

0 comments on commit e88e48f

Please sign in to comment.