Apps-android-commons: Crash on upload picture with right to left languages

Created on 16 Feb 2018  路  5Comments  路  Source: commons-app/apps-android-commons

Change your phone language to Arabic, try to upload a picture. It results this crash:
02-16 00:32:56.294 32006-32006/fr.free.nrw.commons.debug E/AndroidRuntime: FATAL EXCEPTION: main Process: fr.free.nrw.commons.debug, PID: 32006 java.lang.NullPointerException at fr.free.nrw.commons.upload.SingleUploadFragment.titleInfo(SingleUploadFragment.java:232) at fr.free.nrw.commons.upload.SingleUploadFragment_ViewBinding$1.onTouch(SingleUploadFragment_ViewBinding.java:46) at android.view.View.dispatchTouchEvent(View.java:7772)

assigned bug good first issue

Most helpful comment

Successfully replicated the error.
Starting work on it :)

All 5 comments

@neslihanturan I was unable to replicate the error and uploaded a picture successfully with the phone language to Arabic. Could you share some more details?

Sure, test device API 4.4.2, whenever I click to edit title or description it gives me:
npe
NPE on line 232 of SingleUploadFragment.java


        //Should replace right with end to support different right-to-left languages as well
        final int value = titleEdit.getRight() - titleEdit.getCompoundDrawables()[2].getBounds().width();

Successfully replicated the error.
Starting work on it :)

Awesome @diddypod. Let us know if you need any help with it. :)

I've fixed it and created a PR (#1172). Please check :)

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Saral-code picture Saral-code  路  3Comments

psh picture psh  路  4Comments

misaochan picture misaochan  路  3Comments

Opsylac picture Opsylac  路  3Comments

domdomegg picture domdomegg  路  3Comments