bumptech / bumptech/glide

GifFrameLoader NPE

Open
#5,267 3 comments 1 reaction 0 assignees View on GitHub
Dominant language
Java
Stars
35k
Forks
6.2k
Avg merge
1d 11h
Merged PRs (30d)
8

Description

**Glide Version**:4.15.1

**Integration libraries**:OKhttp

**Device/Android Version**:11,12,13

**Issue details / Repro steps / Use case background**:
After loading the Gif resource, the GifDrawable implements the FrameCallback interface, but the Drawable may be recycled, but the callback is distributed through the Handler, so there may be a situation where the reference has been recycled, resulting in a null pointer exception. It is hoped that a short judgment can be made at the place of acquisition

java.lang.NullPointerException: Attempt to invoke interface method 'void com.bumptech.glide.load.resource.gif.GifFrameLoader$FrameCallback.g()' on a null object reference
08-25 08:32:38.046 23397 23397 E AndroidRuntime: at com.bumptech.glide.load.resource.gif.GifFrameLoader.a(GifFrameLoader.java:287)
08-25 08:32:38.046 23397 23397 E AndroidRuntime: at com.bumptech.glide.load.resource.gif.GifFrameLoader$FrameLoaderCallback.handleMessage(GifFrameLoader.java:308)
08-25 08:32:38.046 23397 23397 E AndroidRuntime: at android.os.Handler.dispatchMessage(Handler.java:102)
08-25 08:32:38.046 23397 23397 E AndroidRuntime: at android.os.Looper.loopOnce(Looper.java:223)
08-25 08:32:38.046 23397 23397 E AndroidRuntime: at android.os.Looper.loop(Looper.java:324)
08-25 08:32:38.046 23397 23397 E AndroidRuntime: at android.app.ActivityThread.main(ActivityThread.java:8539)
08-25 08:32:38.046 23397 23397 E AndroidRuntime: at java.lang.reflect.Method.invoke(Native Method)
08-25 08:32:38.046 23397 23397 E AndroidRuntime: at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:582)
08-25 08:32:38.046 23397 23397 E AndroidRuntime: at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1059)
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.