diff --git a/src/main/java/com/budiyev/android/imageloader/BaseLoadImageAction.java b/src/main/java/com/budiyev/android/imageloader/BaseLoadImageAction.java index d888daa..f41041d 100644 --- a/src/main/java/com/budiyev/android/imageloader/BaseLoadImageAction.java +++ b/src/main/java/com/budiyev/android/imageloader/BaseLoadImageAction.java @@ -144,23 +144,25 @@ private void loadImage() { image = storageCache.get(key); } Context context = mContext; - if (image == null) { - try { - image = mBitmapLoader.load(context, data); - } catch (Throwable error) { - ErrorCallback errorCallback = mErrorCallback; - if (errorCallback != null) { - errorCallback.onError(context, data, error); - } - return; + if (image != null) { + notifyImageLoaded(context, data, image); + return; + } + try { + image = mBitmapLoader.load(context, data); + } catch (Throwable error) { + ErrorCallback errorCallback = mErrorCallback; + if (errorCallback != null) { + errorCallback.onError(context, data, error); } - if (image == null) { - ErrorCallback errorCallback = mErrorCallback; - if (errorCallback != null) { - errorCallback.onError(context, data, new ImageNotLoadedException()); - } - return; + return; + } + if (image == null) { + ErrorCallback errorCallback = mErrorCallback; + if (errorCallback != null) { + errorCallback.onError(context, data, new ImageNotLoadedException()); } + return; } if (mCancelled) { return;