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 after removing table #15

Closed pawlosck closed 6 months ago

pawlosck commented 1 year ago

Describe the bug App crashed when I removed table created some time ago via web app. There is only one table.

Steps to reproduce the behavior:

  1. Create table via web app
  2. Install Android app via fdroid
  3. Login to app using existed account in Android
  4. Open Android app - App will display created table. Screen will be switched beetwen table name and someting other. Table name will be changed for a moment (about 1/10 second) and next display correct table name. After 1-2 seconds, table name changed again.
  5. Remove table from Android App. App crashed

Expected behavior Table should be removed and app should display list of existed tables

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 'long it.niedermann.nextcloud.tables.database.entity.Table.getId()' on a null object reference
    at it.niedermann.nextcloud.tables.repository.TablesRepository.getNotDeletedRows$(TablesRepository.java:103)
    at it.niedermann.nextcloud.tables.ui.table.view.ViewTableViewModel.getFullTable(ViewTableViewModel.java:78)
    at it.niedermann.nextcloud.tables.ui.table.view.ViewTableViewModel$$ExternalSyntheticLambda5.invoke(Unknown Source:4)
    at androidx.lifecycle.Transformations$switchMap$1.onChanged(Transformations.kt:124)
    at androidx.lifecycle.MediatorLiveData$Source.onChanged(MediatorLiveData.java:171)
    at androidx.lifecycle.LiveData.considerNotify(LiveData.java:133)
    at androidx.lifecycle.LiveData.dispatchingValue(LiveData.java:151)
    at androidx.lifecycle.LiveData.setValue(LiveData.java:309)
    at androidx.lifecycle.MutableLiveData.setValue(MutableLiveData.java:50)
    at androidx.lifecycle.Transformations$distinctUntilChanged$1.invoke(Transformations.kt:192)
    at androidx.lifecycle.Transformations$distinctUntilChanged$1.invoke(Transformations.kt:185)
    at androidx.lifecycle.Transformations$sam$androidx_lifecycle_Observer$0.onChanged(Unknown Source:2)
    at androidx.lifecycle.MediatorLiveData$Source.onChanged(MediatorLiveData.java:171)
    at androidx.lifecycle.LiveData.considerNotify(LiveData.java:133)
    at androidx.lifecycle.LiveData.dispatchingValue(LiveData.java:151)
    at androidx.lifecycle.LiveData.setValue(LiveData.java:309)
    at androidx.lifecycle.LiveData$1.run(LiveData.java:93)
    at android.os.Handler.handleCallback(Handler.java:873)
    at android.os.Handler.dispatchMessage(Handler.java:99)
    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)
mr-bolle commented 12 months ago
Full Crash:

App Version: 1.1.2
App Version Code: 1001002
App Flavor: fdroid

Files App Version Code: 30260090 (PROD)
Files App Version Code: 20230906 (DEV)

---

OS Version: 5.15.78-android13-3-27100863(A546BXXU5AWHA)
OS API Level: 33
Device: a54x
Manufacturer: samsung
Model (and Product): SM-A546B (a54xnaeea)

---

java.lang.NullPointerException: Attempt to invoke virtual method 'long it.niedermann.nextcloud.tables.database.entity.Table.getId()' on a null object reference
    at it.niedermann.nextcloud.tables.repository.TablesRepository.getNotDeletedRows$(TablesRepository.java:103)
    at it.niedermann.nextcloud.tables.ui.table.view.ViewTableViewModel.getFullTable(ViewTableViewModel.java:78)
    at it.niedermann.nextcloud.tables.ui.table.view.ViewTableViewModel$$ExternalSyntheticLambda5.invoke(Unknown Source:4)
    at androidx.lifecycle.Transformations$switchMap$1.onChanged(Transformations.kt:124)
    at androidx.lifecycle.MediatorLiveData$Source.onChanged(MediatorLiveData.java:171)
    at androidx.lifecycle.LiveData.considerNotify(LiveData.java:133)
    at androidx.lifecycle.LiveData.dispatchingValue(LiveData.java:151)
    at androidx.lifecycle.LiveData.setValue(LiveData.java:309)
    at androidx.lifecycle.MutableLiveData.setValue(MutableLiveData.java:50)
    at androidx.lifecycle.Transformations$distinctUntilChanged$1.invoke(Transformations.kt:192)
    at androidx.lifecycle.Transformations$distinctUntilChanged$1.invoke(Transformations.kt:185)
    at androidx.lifecycle.Transformations$sam$androidx_lifecycle_Observer$0.onChanged(Unknown Source:2)
    at androidx.lifecycle.MediatorLiveData$Source.onChanged(MediatorLiveData.java:171)
    at androidx.lifecycle.LiveData.considerNotify(LiveData.java:133)
    at androidx.lifecycle.LiveData.dispatchingValue(LiveData.java:151)
    at androidx.lifecycle.LiveData.setValue(LiveData.java:309)
    at androidx.lifecycle.LiveData$1.run(LiveData.java:93)
    at android.os.Handler.handleCallback(Handler.java:942)
    at android.os.Handler.dispatchMessage(Handler.java:99)
    at android.os.Looper.loopOnce(Looper.java:226)
    at android.os.Looper.loop(Looper.java:313)
    at android.app.ActivityThread.main(ActivityThread.java:8762)
    at java.lang.reflect.Method.invoke(Native Method)
    at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:604)
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1067)
stefan-niedermann commented 6 months ago

Thank you for the report. The fix will be published with 1.1.3.