App crash viewing markdown with image with empty link #1233

Closed
opened 2023-01-09 16:43:28 +00:00 by fsologureng · 7 comments

# Describe your matter briefly


I tried to view an issue where the creator had mentioned it to me and closed it, and when the view started to display, it shows a simple list of comments, but apparently when it starts to display each comment, the application crashes. The issue mentioned is this.
Before the last comment, I could see the issue with the app.
The crash occurs if I enter from the notification list or directly from the issue tracker.

What did you expect?

The issue finished to load and show all the comments as usual.

Some additional details

  • The version of Gitea you are using:
    Forgejo (Codeberg) 1.18.0+50-g5a46a564

  • The version of GitNex you are using:
    4.5.0 / 450

  • Source of installation (Play Store, F-Droid, APK):
    F-Droid

  • Current android version and phone model/manufacturer:
    7.1.2 Redmi Note 5A Prime/Xiaomi

  • The type of certificate your instance is using (self-signed, signed):
    signed

  • How you used to log in (via password or token):
    token

We would appreciate some screenshots or stacktrace's, but this is also not required.



Thank you.

## # Describe your matter briefly --- I tried to view an issue where the creator had mentioned it to me and closed it, and when the view started to display, it shows a simple list of comments, but apparently when it starts to display each comment, the application crashes. The issue mentioned is [this](https://codeberg.org/Codeberg/Community/issues/875). Before the last comment, I could see the issue with the app. The crash occurs if I enter from the notification list or directly from the issue tracker. ##### What did you expect? --- The issue finished to load and show all the comments as usual. ##### Some additional details --- * The version of **Gitea** you are using: Forgejo (Codeberg) 1.18.0+50-g5a46a564 * The version of **GitNex** you are using: 4.5.0 / 450 * Source of installation (Play Store, F-Droid, APK): F-Droid * Current android version and phone model/manufacturer: 7.1.2 Redmi Note 5A Prime/Xiaomi * The type of certificate your instance is using (self-signed, signed): signed * How you used to log in (via password or token): token ##### We would appreciate some screenshots or stacktrace's, but this is also not required. --- <!-- Screenshots and stacktrace's can go here. --> <br><br> - [x] I carefully read the [contribution guidelines](https://codeberg.org/gitnex/GitNex/wiki/Contributing). <br> <!-- Thank you for your time. --> Thank you.
Contributor

Can reproduce wiith the given link. Stacktrace:

FATAL EXCEPTION: main
Process: org.mian.gitnex, PID: 9582
java.lang.IllegalArgumentException: Path must not be empty.
	at com.squareup.picasso.Picasso.load(Picasso.java:332)
	at io.noties.markwon.image.picasso.PicassoImagesPlugin$1.load(PicassoImagesPlugin.java:56)
	at io.noties.markwon.image.picasso.PicassoImagesPlugin$PicassoAsyncDrawableLoader.load(PicassoImagesPlugin.java:116)
	at io.noties.markwon.image.AsyncDrawable.setCallback2(AsyncDrawable.java:152)
	at io.noties.markwon.image.AsyncDrawableScheduler.schedule(AsyncDrawableScheduler.java:67)
	at io.noties.markwon.image.picasso.PicassoImagesPlugin.afterSetText(PicassoImagesPlugin.java:96)
	at io.noties.markwon.MarkwonImpl.setParsedMarkdown(MarkwonImpl.java:140)
	at io.noties.markwon.recycler.SimpleEntry.bindHolder(SimpleEntry.java:65)
	at io.noties.markwon.recycler.SimpleEntry.bindHolder(SimpleEntry.java:24)
	at io.noties.markwon.recycler.MarkwonAdapterImpl.onBindViewHolder(MarkwonAdapterImpl.java:85)
	at io.noties.markwon.recycler.MarkwonAdapterImpl.onBindViewHolder(MarkwonAdapterImpl.java:17)
	at androidx.recyclerview.widget.RecyclerView$Adapter.onBindViewHolder(RecyclerView.java:7254)
	at androidx.recyclerview.widget.RecyclerView$Adapter.bindViewHolder(RecyclerView.java:7337)
	at androidx.recyclerview.widget.RecyclerView$Recycler.tryBindViewHolderByDeadline(RecyclerView.java:6194)
	at androidx.recyclerview.widget.RecyclerView$Recycler.tryGetViewHolderForPositionByDeadline(RecyclerView.java:6460)
	at androidx.recyclerview.widget.RecyclerView$Recycler.getViewForPosition(RecyclerView.java:6300)
	at androidx.recyclerview.widget.RecyclerView$Recycler.getViewForPosition(RecyclerView.java:6296)
	at androidx.recyclerview.widget.LinearLayoutManager$LayoutState.next(LinearLayoutManager.java:2330)
	at androidx.recyclerview.widget.LinearLayoutManager.layoutChunk(LinearLayoutManager.java:1631)
	at androidx.recyclerview.widget.LinearLayoutManager.fill(LinearLayoutManager.java:1591)
	at androidx.recyclerview.widget.LinearLayoutManager.onLayoutChildren(LinearLayoutManager.java:668)
	at androidx.recyclerview.widget.RecyclerView.dispatchLayoutStep2(RecyclerView.java:4309)
	at androidx.recyclerview.widget.RecyclerView.onMeasure(RecyclerView.java:3686)
	at android.view.View.measure(View.java:25791)
	at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:6980)
	at android.widget.LinearLayout.measureChildBeforeLayout(LinearLayout.java:1552)
	at android.widget.LinearLayout.measureVertical(LinearLayout.java:842)
	at android.widget.LinearLayout.onMeasure(LinearLayout.java:721)
	at android.view.View.measure(View.java:25791)
	at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:6980)
	at android.widget.FrameLayout.onMeasure(FrameLayout.java:194)
	at androidx.cardview.widget.CardView.onMeasure(CardView.java:260)
	at com.google.android.material.card.MaterialCardView.onMeasure(MaterialCardView.java:206)
	at android.view.View.measure(View.java:25791)
	at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:6980)
	at android.widget.LinearLayout.measureChildBeforeLayout(LinearLayout.java:1552)
	at android.widget.LinearLayout.measureVertical(LinearLayout.java:842)
	at android.widget.LinearLayout.onMeasure(LinearLayout.java:721)
	at android.view.View.measure(View.java:25791)
	at androidx.recyclerview.widget.RecyclerView$LayoutManager.measureChildWithMargins(RecyclerView.java:9681)
	at androidx.recyclerview.widget.LinearLayoutManager.layoutChunk(LinearLayoutManager.java:1657)
	at androidx.recyclerview.widget.LinearLayoutManager.fill(LinearLayoutManager.java:1591)
	at androidx.recyclerview.widget.LinearLayoutManager.onLayoutChildren(LinearLayoutManager.java:668)
	at androidx.recyclerview.widget.RecyclerView.dispatchLayoutStep2(RecyclerView.java:4309)
	at androidx.recyclerview.widget.RecyclerView.onMeasure(RecyclerView.java:3686)
	at android.view.View.measure(View.java:25791)
	at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:6980)
	at android.widget.FrameLayout.onMeasure(FrameLayout.java:194)
	at android.view.View.measure(View.java:25791)
	at android.widget.RelativeLayout.measureChildHorizontal(RelativeLayout.java:735)
	at android.widget.RelativeLayout.onMeasure(RelativeLayout.java:481)
	at android.view.View.measure(View.java:25791)
	at androidx.core.widget.NestedScrollView.measureChildWithMargins(NestedScrollView.java:1695)
	at android.widget.FrameLayout.onMeasure(FrameLayout.java:194)
	at androidx.core.widget.NestedScrollView.onMeasure(NestedScrollView.java:604)
	at android.view.View.measure(View.java:25791)
	at androidx.swiperefreshlayout.widget.SwipeRefreshLayout.onMeasure(SwipeRefreshLayout.java:641)
	at android.view.View.measure(View.java:25791)
	at android.widget.RelativeLayout.measureChildHorizontal(RelativeLayout.java:735)
	at android.widget.RelativeLayout.onMeasure(RelativeLayout.java:481)
	at android.view.View.measure(View.java:25791)
	at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:6980)
	at androidx.coordinatorlayout.widget.CoordinatorLayout.onMeasureChild(CoordinatorLayout.java:760)
	at androidx.coordinatorlayout.widget.CoordinatorLayout.onMeasure(CoordinatorLayout.java:833)
	at android.view.View.measure(View.java:25791)
	at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:6980)
	at android.widget.FrameLayout.onMeasure(FrameLayout.java:194)
	at androidx.appcompat.widget.ContentFrameLayout.onMeasure(ContentFrameLayout.java:145)
	at android.view.View.measure(View.java:25791)
	at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:6980)
	at android.widget.LinearLayout.measureChildBeforeLayout(LinearLayout.java:1552)
	at android.widget.LinearLayout.measureVertical(LinearLayout.java:842)
	at android.widget.LinearLayout.onMeasure(LinearLayout.java:721)
	at android.view.View.measure(View.java:25791)
	at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:6980)
	at android.widget.FrameLayout.onMeasure(FrameLayout.java:194)
	at android.view.View.measure(View.java:25791)
	at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:6980)
	at android.widget.LinearLayout.measureChildBeforeLayout(LinearLayout.java:1552)
	at android.widget.LinearLayout.measureVertical(LinearLayout.java:842)
	at android.widget.LinearLayout.onMeasure(LinearLayout.java:721)
	at android.view.View.measure(View.java:25791)
	at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:6980)
	at android.widget.FrameLayout.onMeasure(FrameLayout.java:194)
	at com.android.internal.policy.DecorView.onMeasure(DecorView.java:761)
	at android.view.View.measure(View.java:25791)
	at android.view.ViewRootImpl.performMeasure(ViewRootImpl.java:3614)
	at android.view.ViewRootImpl.measureHierarchy(ViewRootImpl.java:2410)
	at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:2680)
	at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:2129)
	at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:8663)
	at android.view.Choreographer$CallbackRecord.run(Choreographer.java:1120)
	at android.view.Choreographer.doCallbacks(Choreographer.java:926)
	at android.view.Choreographer.doFrame(Choreographer.java:859)
	at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:1105)
	at android.os.Handler.handleCallback(Handler.java:938)
	at android.os.Handler.dispatchMessage(Handler.java:99)
	at android.os.Looper.loopOnce(Looper.java:201)
	at android.os.Looper.loop(Looper.java:288)
	at android.app.ActivityThread.main(ActivityThread.java:7880)
	at java.lang.reflect.Method.invoke(Native Method)
	at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:548)
	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1009)
Can reproduce wiith the given link. Stacktrace: ``` FATAL EXCEPTION: main Process: org.mian.gitnex, PID: 9582 java.lang.IllegalArgumentException: Path must not be empty. at com.squareup.picasso.Picasso.load(Picasso.java:332) at io.noties.markwon.image.picasso.PicassoImagesPlugin$1.load(PicassoImagesPlugin.java:56) at io.noties.markwon.image.picasso.PicassoImagesPlugin$PicassoAsyncDrawableLoader.load(PicassoImagesPlugin.java:116) at io.noties.markwon.image.AsyncDrawable.setCallback2(AsyncDrawable.java:152) at io.noties.markwon.image.AsyncDrawableScheduler.schedule(AsyncDrawableScheduler.java:67) at io.noties.markwon.image.picasso.PicassoImagesPlugin.afterSetText(PicassoImagesPlugin.java:96) at io.noties.markwon.MarkwonImpl.setParsedMarkdown(MarkwonImpl.java:140) at io.noties.markwon.recycler.SimpleEntry.bindHolder(SimpleEntry.java:65) at io.noties.markwon.recycler.SimpleEntry.bindHolder(SimpleEntry.java:24) at io.noties.markwon.recycler.MarkwonAdapterImpl.onBindViewHolder(MarkwonAdapterImpl.java:85) at io.noties.markwon.recycler.MarkwonAdapterImpl.onBindViewHolder(MarkwonAdapterImpl.java:17) at androidx.recyclerview.widget.RecyclerView$Adapter.onBindViewHolder(RecyclerView.java:7254) at androidx.recyclerview.widget.RecyclerView$Adapter.bindViewHolder(RecyclerView.java:7337) at androidx.recyclerview.widget.RecyclerView$Recycler.tryBindViewHolderByDeadline(RecyclerView.java:6194) at androidx.recyclerview.widget.RecyclerView$Recycler.tryGetViewHolderForPositionByDeadline(RecyclerView.java:6460) at androidx.recyclerview.widget.RecyclerView$Recycler.getViewForPosition(RecyclerView.java:6300) at androidx.recyclerview.widget.RecyclerView$Recycler.getViewForPosition(RecyclerView.java:6296) at androidx.recyclerview.widget.LinearLayoutManager$LayoutState.next(LinearLayoutManager.java:2330) at androidx.recyclerview.widget.LinearLayoutManager.layoutChunk(LinearLayoutManager.java:1631) at androidx.recyclerview.widget.LinearLayoutManager.fill(LinearLayoutManager.java:1591) at androidx.recyclerview.widget.LinearLayoutManager.onLayoutChildren(LinearLayoutManager.java:668) at androidx.recyclerview.widget.RecyclerView.dispatchLayoutStep2(RecyclerView.java:4309) at androidx.recyclerview.widget.RecyclerView.onMeasure(RecyclerView.java:3686) at android.view.View.measure(View.java:25791) at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:6980) at android.widget.LinearLayout.measureChildBeforeLayout(LinearLayout.java:1552) at android.widget.LinearLayout.measureVertical(LinearLayout.java:842) at android.widget.LinearLayout.onMeasure(LinearLayout.java:721) at android.view.View.measure(View.java:25791) at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:6980) at android.widget.FrameLayout.onMeasure(FrameLayout.java:194) at androidx.cardview.widget.CardView.onMeasure(CardView.java:260) at com.google.android.material.card.MaterialCardView.onMeasure(MaterialCardView.java:206) at android.view.View.measure(View.java:25791) at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:6980) at android.widget.LinearLayout.measureChildBeforeLayout(LinearLayout.java:1552) at android.widget.LinearLayout.measureVertical(LinearLayout.java:842) at android.widget.LinearLayout.onMeasure(LinearLayout.java:721) at android.view.View.measure(View.java:25791) at androidx.recyclerview.widget.RecyclerView$LayoutManager.measureChildWithMargins(RecyclerView.java:9681) at androidx.recyclerview.widget.LinearLayoutManager.layoutChunk(LinearLayoutManager.java:1657) at androidx.recyclerview.widget.LinearLayoutManager.fill(LinearLayoutManager.java:1591) at androidx.recyclerview.widget.LinearLayoutManager.onLayoutChildren(LinearLayoutManager.java:668) at androidx.recyclerview.widget.RecyclerView.dispatchLayoutStep2(RecyclerView.java:4309) at androidx.recyclerview.widget.RecyclerView.onMeasure(RecyclerView.java:3686) at android.view.View.measure(View.java:25791) at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:6980) at android.widget.FrameLayout.onMeasure(FrameLayout.java:194) at android.view.View.measure(View.java:25791) at android.widget.RelativeLayout.measureChildHorizontal(RelativeLayout.java:735) at android.widget.RelativeLayout.onMeasure(RelativeLayout.java:481) at android.view.View.measure(View.java:25791) at androidx.core.widget.NestedScrollView.measureChildWithMargins(NestedScrollView.java:1695) at android.widget.FrameLayout.onMeasure(FrameLayout.java:194) at androidx.core.widget.NestedScrollView.onMeasure(NestedScrollView.java:604) at android.view.View.measure(View.java:25791) at androidx.swiperefreshlayout.widget.SwipeRefreshLayout.onMeasure(SwipeRefreshLayout.java:641) at android.view.View.measure(View.java:25791) at android.widget.RelativeLayout.measureChildHorizontal(RelativeLayout.java:735) at android.widget.RelativeLayout.onMeasure(RelativeLayout.java:481) at android.view.View.measure(View.java:25791) at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:6980) at androidx.coordinatorlayout.widget.CoordinatorLayout.onMeasureChild(CoordinatorLayout.java:760) at androidx.coordinatorlayout.widget.CoordinatorLayout.onMeasure(CoordinatorLayout.java:833) at android.view.View.measure(View.java:25791) at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:6980) at android.widget.FrameLayout.onMeasure(FrameLayout.java:194) at androidx.appcompat.widget.ContentFrameLayout.onMeasure(ContentFrameLayout.java:145) at android.view.View.measure(View.java:25791) at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:6980) at android.widget.LinearLayout.measureChildBeforeLayout(LinearLayout.java:1552) at android.widget.LinearLayout.measureVertical(LinearLayout.java:842) at android.widget.LinearLayout.onMeasure(LinearLayout.java:721) at android.view.View.measure(View.java:25791) at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:6980) at android.widget.FrameLayout.onMeasure(FrameLayout.java:194) at android.view.View.measure(View.java:25791) at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:6980) at android.widget.LinearLayout.measureChildBeforeLayout(LinearLayout.java:1552) at android.widget.LinearLayout.measureVertical(LinearLayout.java:842) at android.widget.LinearLayout.onMeasure(LinearLayout.java:721) at android.view.View.measure(View.java:25791) at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:6980) at android.widget.FrameLayout.onMeasure(FrameLayout.java:194) at com.android.internal.policy.DecorView.onMeasure(DecorView.java:761) at android.view.View.measure(View.java:25791) at android.view.ViewRootImpl.performMeasure(ViewRootImpl.java:3614) at android.view.ViewRootImpl.measureHierarchy(ViewRootImpl.java:2410) at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:2680) at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:2129) at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:8663) at android.view.Choreographer$CallbackRecord.run(Choreographer.java:1120) at android.view.Choreographer.doCallbacks(Choreographer.java:926) at android.view.Choreographer.doFrame(Choreographer.java:859) at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:1105) at android.os.Handler.handleCallback(Handler.java:938) at android.os.Handler.dispatchMessage(Handler.java:99) at android.os.Looper.loopOnce(Looper.java:201) at android.os.Looper.loop(Looper.java:288) at android.app.ActivityThread.main(ActivityThread.java:7880) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:548) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1009) ```
Owner

I also can reproduce it.

I also can reproduce it.
mmarif added the
🐛 Bug
label 2023-01-10 06:36:07 +00:00
Owner

So I tried to debug this issue and found the following.

1- The crash is happening in comments.

2- The crash is coming from Markdown.java using the Picasso plugin.

3- The path to image is incomplete and thus Picasso cannot load the image and hence the crash occur.

See the attached images.

So I tried to debug this issue and found the following. 1- The crash is happening in comments. 2- The crash is coming from `Markdown.java` using the Picasso plugin. 3- The path to image is incomplete and thus Picasso cannot load the image and hence the crash occur. See the attached images.
Author

Weird that your attached images have the URL with protocol, domain et all and the inserted ones in the comment in question don't.

Thanks for explaining.

Weird that your attached images have the URL with protocol, domain et all and the inserted ones in the comment in question don't. Thanks for explaining.
Owner

On this, I think it should be fixed upstream instead of us just applying patches. That's the best way forward and it will be the same as web ui too.

On this, I think it should be fixed upstream instead of us just applying patches. That's the best way forward and it will be the same as web ui too.
qwerty287 changed title from App crash viewing a closed issue with a direct mention to me to App crash viewing markdown with image with empty link 2023-02-06 17:37:11 +00:00
mmarif added the
🪜 Upstream
label 2023-03-27 14:09:43 +00:00

Hi this was 10 months ago any news on this? if not please close it!

Hi this was 10 months ago any news on this? if not please close it!
Owner

this was 10 months ago any news on this?

Hi, this is tagged as upstream, and the conversation explains why. If it is fixed, please share a link or pull request.

if not please close it!

Closing it or keeping it open will not change anything in the upstream project. However, let's keep it open for now.

> this was 10 months ago any news on this? Hi, this is tagged as `upstream`, and the conversation explains why. If it is fixed, please share a link or pull request. > if not please close it! Closing it or keeping it open will not change anything in the upstream project. However, let's keep it open for now.
mmarif removed the
🪜 Upstream
label 2024-03-29 06:48:10 +00:00
mmarif added this to the 5.4.0 milestone 2024-03-29 06:48:17 +00:00
mmarif self-assigned this 2024-03-29 06:48:29 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
4 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: gitnex/GitNex#1233
No description provided.