LucasGGamerM / moshidon

Better modification of the official Mastodon for Android app
https://LucasGGamerM.github.io/moshidon/
GNU General Public License v3.0
659 stars 32 forks source link

Moshidon crash when I tap on 'translate from Russian (to english) on that particular toot #565

Open harrykar opened 3 weeks ago

harrykar commented 3 weeks ago

The crash is reproducable every time you try to tap 'translate from Russian' link on that exact post (I did it 3 consecutive times and crashed all of them): https://mastodon.social/@linuxmasterclub/113429674831935522

Ps: Notice that on another Russian lang post tap on 'translate from Russian' link work as intended e.g. https://zhub.link/@habr/113429691428737668

Device & OS: Samsung Galaxy Tab A (2016) Model : SM-T580 Android version: 8.1.0 Samsung experience version: 9.5 Kernel version: 3.18.14

Here's the the log of the last crash:

2.3.0+fork.107.moshinda (107) 2024-11-05T10:00:18.308Z

java.lang.StringIndexOutOfBoundsException: length=0; index=1 at java.lang.String.substring(String.java:1939) at org.joinmastodon.android.ui.text.HtmlParser$1.head(HtmlParser.java:147) at org.jsoup.select.NodeTraversor.traverse(NodeTraversor.java:30) at org.jsoup.nodes.Node.traverse(Node.java:625) at org.jsoup.nodes.Element.traverse(Element.java:1708) at org.joinmastodon.android.ui.text.HtmlParser.parse(HtmlParser.java:129) at org.joinmastodon.android.ui.text.HtmlParser.parse(HtmlParser.java:83) at org.joinmastodon.android.ui.displayitems.TextStatusDisplayItem.setTranslatedText(TextStatusDisplayItem.java:71) at org.joinmastodon.android.ui.displayitems.TextStatusDisplayItem$Holder.updateTranslation(TextStatusDisplayItem.java:238) at org.joinmastodon.android.fragments.BaseStatusListFragment.updateTranslation(BaseStatusListFragment.java:1107) at org.joinmastodon.android.fragments.BaseStatusListFragment.lambda$togglePostTranslation$4(BaseStatusListFragment.java:1061) at org.joinmastodon.android.fragments.BaseStatusListFragment.$r8$lambda$DwcUcUgGI-XBmEy8dm7weudbws0(BaseStatusListFragment.java:0) at org.joinmastodon.android.fragments.BaseStatusListFragment$$ExternalSyntheticLambda11.accept(R8$$SyntheticClass:0) at org.joinmastodon.android.fragments.BaseStatusListFragment$8.onSuccess(BaseStatusListFragment.java:1077) at org.joinmastodon.android.fragments.BaseStatusListFragment$8.onSuccess(BaseStatusListFragment.java:1074) at me.grishka.appkit.api.APIRequest$1.run(APIRequest.java:29) at android.os.Handler.handleCallback(Handler.java:790) at android.os.Handler.dispatchMessage(Handler.java:99) at android.os.Looper.loop(Looper.java:164) at android.app.ActivityThread.main(ActivityThread.java:7000) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:441) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1408)

harrykar commented 2 weeks ago

Idem in that post https://mastodon.social/@D3Lab/113441612145201634