Avoid NPE in deleteAvatar#onError

Exception java.lang.NullPointerException:
  at com.nextcloud.talk.controllers.ProfileController$save$1.onError (ProfileController.kt:457)
  at io.reactivex.internal.operators.observable.ObservableObserveOn$ObserveOnObserver.checkTerminated (ObservableObserveOn.java:281)
  at io.reactivex.internal.operators.observable.ObservableObserveOn$ObserveOnObserver.drainNormal (ObservableObserveOn.java:172)
  at io.reactivex.internal.operators.observable.ObservableObserveOn$ObserveOnObserver.run (ObservableObserveOn.java:255)
  at io.reactivex.android.schedulers.HandlerScheduler$ScheduledRunnable.run (HandlerScheduler.java:124)
  at android.os.Handler.handleCallback (Handler.java:883)
  at android.os.Handler.dispatchMessage (Handler.java:100)
  at android.os.Looper.loop (Looper.java:237)
  at android.app.ActivityThread.main (ActivityThread.java:8167)
  at java.lang.reflect.Method.invoke
  at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run (RuntimeInit.java:496)
  at com.android.internal.os.ZygoteInit.main (ZygoteInit.java:1100)

Signed-off-by: Marcel Hibbe <dev@mhibbe.de>
This commit is contained in:
Marcel Hibbe 2023-03-23 12:20:12 +01:00
parent 60f0c1e079
commit 69dae28f83
No known key found for this signature in database
GPG key ID: C793F8B59F43CE7B

View file

@ -222,7 +222,7 @@ class ProfileController : BaseController(R.layout.controller_profile) {
}
override fun onError(e: Throwable) {
Toast.makeText(applicationContext, "Error", Toast.LENGTH_LONG).show()
Log.e(TAG, "Failed to delete avatar", e)
}
override fun onComplete() {