stefan-niedermann / nextcloud-tables

📊 Android client for nextcloud tables app
https://play.google.com/store/apps/details?id=it.niedermann.nextcloud.tables.play
GNU General Public License v3.0
29 stars 5 forks source link

App crashed when user touch the header of column (no rows) #16

Closed pawlosck closed 1 year ago

pawlosck commented 1 year ago

Describe the bug App crashed when user touch the header of table (screenshot)

Steps to reproduce the behavior:

  1. Create table via web app
  2. Create few columns. Second column with type Selection (five items)
  3. Remove last item and create again with the same value
  4. Save table
  5. Open this table in Android and touch header of table. App crashed

Expected behavior Should be opened edit mode or something like that.

Versions

Smartphone (please complete the following information):

Stacktrace

Full Crash:

App Version: 1.1.0
App Version Code: 1001000
App Flavor: fdroid

Files App Version Code: 30250090 (PROD)

---

OS Version: 4.4.111-21427293(G950FXXUCDVG4)
OS API Level: 28
Device: dreamlte
Manufacturer: samsung
Model (and Product): SM-G950F (dreamltexx)

---

java.lang.NullPointerException: Attempt to invoke virtual method 'androidx.recyclerview.widget.RecyclerView$ViewHolder com.evrencoskun.tableview.adapter.recyclerview.CellRecyclerView.findViewHolderForAdapterPosition(int)' on a null object reference
    at com.evrencoskun.tableview.handler.SelectionHandler.changeVisibleCellViewsBackgroundForColumn(SelectionHandler.java:353)
    at com.evrencoskun.tableview.handler.SelectionHandler.selectedColumnHeader(SelectionHandler.java:235)
    at com.evrencoskun.tableview.handler.SelectionHandler.setSelectedColumnPosition(SelectionHandler.java:92)
    at com.evrencoskun.tableview.listener.itemclick.ColumnHeaderRecyclerViewItemClickListener.clickAction(ColumnHeaderRecyclerViewItemClickListener.java:63)
    at com.evrencoskun.tableview.listener.itemclick.AbstractItemClickListener$1.onSingleTapConfirmed(AbstractItemClickListener.java:72)
    at android.view.GestureDetector$GestureHandler.handleMessage(GestureDetector.java:316)
    at android.os.Handler.dispatchMessage(Handler.java:106)
    at android.os.Looper.loop(Looper.java:214)
    at android.app.ActivityThread.main(ActivityThread.java:7050)
    at java.lang.reflect.Method.invoke(Native Method)
    at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:494)
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:965)

obraz obraz

stefan-niedermann commented 1 year ago

Thank you for the report! This is a bit tricky as it actually is not a bug in the Tables Android App but a known issue in the upstream library tableview, so we unfortunately can't fix it directly.

As a workaround we will hide the column headers when there are no rows starting with version 1.1.1 - Please reopen in case it occurs with this or a later version. We will add a proper empty content view in a later release for a better user experience.