ismail-s / JTime

Project has moved to https://www.gitlab.com/ismail-s/jtime
https://jtime.ismail-s.com
GNU General Public License v2.0
5 stars 0 forks source link

Fix crashes due to calls to setRefreshing method #259

Closed ismail-s closed 7 years ago

ismail-s commented 7 years ago

In the pre-launch report for version 1.6.0 of the app, the following stack trace appeared several times (deobfuscated):

java.lang.NullPointerException: Attempt to invoke virtual method 'void android.s
upport.v4.widget.SwipeRefreshLayout.setRefreshing(boolean)' on a null object ref
erence
        at com.ismail_s.jtime.android.fragment.AllMasjidsFragment.hideRefreshIco
n(AllMasjidsFragment.java)
        at com.ismail_s.jtime.android.fragment.AllMasjidsFragment.onCreateView(A
llMasjidsFragment.java)
                                                                  onRefresh(AllM
asjidsFragment.java)
                                                                  onLocationChan
ged(AllMasjidsFragment.java)
                                                                  sortMasjidsByL
ocation(AllMasjidsFragment.java)
                                                                  sortMasjidsByN
ame(AllMasjidsFragment.java)
                                                                  access$hideRef
reshIcon(AllMasjidsFragment.java)
                                                                  access$sortMas
jidsByLocation(AllMasjidsFragment.java)
                                                                  access$sortMas
jidsByName(AllMasjidsFragment.java)
        at com.ismail_s.jtime.android.fragment.AllMasjidsFragment$onRefresh$1$2.
invoke(AllMasjidsFragment.java)
        at com.ismail_s.jtime.android.fragment.AllMasjidsFragment$onRefresh$1$2.
invoke(AllMasjidsFragment.java)
        at nl.komponents.kovenant.AbstractPromise$FailCallbackContextNode$runFai
l$1.invoke(AbstractPromise.java)
        at nl.komponents.kovenant.AbstractPromise$FailCallbackContextNode$runFai
l$1.invoke(AbstractPromise.java)
        at nl.komponents.kovenant.android.BasicAndroidDispatcher$FnRunnable.run(
BasicAndroidDispatcher.java)
        at nl.komponents.kovenant.android.LooperExecutor.handleMessage(LooperExe
cutor.java)
        at android.os.Handler.dispatchMessage(Handler.java:98)
        at android.os.Looper.loop(Looper.java:145)
        at android.app.ActivityThread.main(ActivityThread.java:6837)
        at java.lang.reflect.Method.invoke(Method.java)
        at java.lang.reflect.Method.invoke(Method.java:372)
        at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit
.java:1404)
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1199)

This caused the app to crash. This needs to be fixed.