I have an Instagram downloader application that recently I get a null pointer error when I want to make a request to Instagram and download public posts. I can download stories but not posts. Does anyone know how to solve this problem?
error log:
2022-02-18 11:33:49.247 29708-29708/ir.alireza.instagram E/PushPole: Exception caught
java.lang.NullPointerException: Attempt to read from field 'sadad.tools.instadownloader.aes.ResponseModel$ShortCodeMedia sadad.tools.instadownloader.aes.ResponseModel$Graphql.shortcode_media' on a null object reference
at sadad.tools.instadownloader.HomeFragment$2.onResponse(HomeFragment.java:506)
at retrofit2.DefaultCallAdapterFactory$ExecutorCallbackCall$1.lambda$onResponse$0$DefaultCallAdapterFactory$ExecutorCallbackCall$1(DefaultCallAdapterFactory.java:89)
at retrofit2.-$$Lambda$DefaultCallAdapterFactory$ExecutorCallbackCall$1$hVGjmafRi6VitDIrPNdoFizVAdk.run(lambda)
at android.os.Handler.handleCallback(Handler.java:751)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:154)
at android.app.ActivityThread.main(ActivityThread.java:6776)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1496)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1386)
The error occurs in this class on Line 506: Null pointer in line 506
ResponseModel.java Here is ResponseModel class
and this is my ApiInterface Here is ApiInterface