LightDestory / FastHub-RE

Revival Attempt for FastHub the ultimate GitHub client for Android.
GNU General Public License v3.0
248 stars 17 forks source link

Crash scrolling feed #45

Open Efreak opened 2 years ago

Efreak commented 2 years ago

I get this crash while scrolling my feed in the app, took quite a while to track it down. Going by the error, I'm guessing it's an issue with a release. I'm trying now to figure out which release it is.

07-05 00:42:26.932 21654 21654 E AndroidRuntime: FATAL EXCEPTION: main
07-05 00:42:26.932 21654 21654 E AndroidRuntime: Process: com.fastaccess.github.revival, PID: 21654
07-05 00:42:26.932 21654 21654 E AndroidRuntime: java.lang.NullPointerException: release!!.name must not be null
07-05 00:42:26.932 21654 21654 E AndroidRuntime:    at com.fastaccess.ui.adapter.viewholder.FeedsViewHolder.appendReleaseEvent(FeedsViewHolder.kt:168)
07-05 00:42:26.932 21654 21654 E AndroidRuntime:    at com.fastaccess.ui.adapter.viewholder.FeedsViewHolder.bind(FeedsViewHolder.kt:101)
07-05 00:42:26.932 21654 21654 E AndroidRuntime:    at com.fastaccess.ui.adapter.FeedsAdapter.onBindView(FeedsAdapter.kt:23)
07-05 00:42:26.932 21654 21654 E AndroidRuntime:    at com.fastaccess.ui.adapter.FeedsAdapter.onBindView(FeedsAdapter.kt:12)
07-05 00:42:26.932 21654 21654 E AndroidRuntime:    at com.fastaccess.ui.base.adapter.BaseRecyclerAdapter.onBindViewHolder(BaseRecyclerAdapter.kt:113)
07-05 00:42:26.932 21654 21654 E AndroidRuntime:    at com.fastaccess.ui.base.adapter.BaseRecyclerAdapter.onBindViewHolder(BaseRecyclerAdapter.kt:18)
07-05 00:42:26.932 21654 21654 E AndroidRuntime:    at androidx.recyclerview.widget.RecyclerView$Adapter.onBindViewHolder(RecyclerView.java:7254)
07-05 00:42:26.932 21654 21654 E AndroidRuntime:    at androidx.recyclerview.widget.RecyclerView$Adapter.bindViewHolder(RecyclerView.java:7337)
07-05 00:42:26.932 21654 21654 E AndroidRuntime:    at androidx.recyclerview.widget.RecyclerView$Recycler.tryBindViewHolderByDeadline(RecyclerView.java:6194)
07-05 00:42:26.932 21654 21654 E AndroidRuntime:    at androidx.recyclerview.widget.RecyclerView$Recycler.tryGetViewHolderForPositionByDeadline(RecyclerView.java:6460)
07-05 00:42:26.932 21654 21654 E AndroidRuntime:    at androidx.recyclerview.widget.GapWorker.prefetchPositionWithDeadline(GapWorker.java:288)
07-05 00:42:26.932 21654 21654 E AndroidRuntime:    at androidx.recyclerview.widget.GapWorker.flushTaskWithDeadline(GapWorker.java:345)
07-05 00:42:26.932 21654 21654 E AndroidRuntime:    at androidx.recyclerview.widget.GapWorker.flushTasksWithDeadline(GapWorker.java:361)
07-05 00:42:26.932 21654 21654 E AndroidRuntime:    at androidx.recyclerview.widget.GapWorker.prefetch(GapWorker.java:368)
07-05 00:42:26.932 21654 21654 E AndroidRuntime:    at androidx.recyclerview.widget.GapWorker.run(GapWorker.java:399)
07-05 00:42:26.932 21654 21654 E AndroidRuntime:    at android.os.Handler.handleCallback(Handler.java:938)
07-05 00:42:26.932 21654 21654 E AndroidRuntime:    at android.os.Handler.dispatchMessage(Handler.java:99)
07-05 00:42:26.932 21654 21654 E AndroidRuntime:    at android.os.Looper.loopOnce(Looper.java:226)
07-05 00:42:26.932 21654 21654 E AndroidRuntime:    at android.os.Looper.loop(Looper.java:313)
07-05 00:42:26.932 21654 21654 E AndroidRuntime:    at android.app.ActivityThread.main(ActivityThread.java:8663)
07-05 00:42:26.932 21654 21654 E AndroidRuntime:    at java.lang.reflect.Method.invoke(Native Method)
07-05 00:42:26.932 21654 21654 E AndroidRuntime:    at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:567)
07-05 00:42:26.932 21654 21654 E AndroidRuntime:    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1135)
LightDestory commented 2 years ago

It seems a release uses a non ASCII character, maybe an emoji?

Why should anyone include an emoji on the release name?

To fix it we should sanitize the release name before updating the view

Iamlooker commented 2 years ago

It seems a release uses a non ASCII character, maybe an emoji?

Why should anyone include an emoji on the release name?

To fix it we should sanitize the release name before updating the view

I myself use emojis in release name, its fun.

Instead of sanitizing I would suggest you simple add support with the help of emoji library with is an extension library for app-compat library