Skip to content

Commit

Permalink
Fix ImageAssetManager.bitmapForId NPE crash, add id in Logger output
Browse files Browse the repository at this point in the history
  • Loading branch information
TechQI authored and TechQI committed Aug 9, 2022
1 parent 693c9d9 commit e2d121a
Showing 1 changed file with 6 additions and 3 deletions.
Original file line number Diff line number Diff line change
@@ -1,17 +1,20 @@
package com.airbnb.lottie.manager;

import android.content.Context;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.graphics.drawable.Drawable;
import androidx.annotation.Nullable;
import android.text.TextUtils;
import android.util.Base64;
import android.view.View;

import androidx.annotation.Nullable;

import com.airbnb.lottie.ImageAssetDelegate;
import com.airbnb.lottie.LottieImageAsset;
import com.airbnb.lottie.utils.Logger;
import com.airbnb.lottie.utils.Utils;

import java.io.IOException;
import java.io.InputStream;
import java.util.HashMap;
Expand Down Expand Up @@ -122,8 +125,8 @@ public void setDelegate(@Nullable ImageAssetDelegate assetDelegate) {
return null;
}
if (bitmap == null) {
Logger.warning("Decoded image is NULL.");
return null;
Logger.warning("Decoded image `" + id + "` is null.");
return null;
}
bitmap = Utils.resizeBitmapIfNeeded(bitmap, asset.getWidth(), asset.getHeight());
return putBitmap(id, bitmap);
Expand Down

0 comments on commit e2d121a

Please # to comment.