From 007c4a97dcfdcd766a8acb203741862c06909dcd Mon Sep 17 00:00:00 2001 From: Marcel Hibbe Date: Thu, 6 Jul 2023 13:41:59 +0200 Subject: [PATCH] fix to allow empty map for phone-number users com.nextcloud.talk2 E Failed to searchContactsByPhoneNumber java.lang.NullPointerException: Parameter specified as non-null is null: method com.nextcloud.talk.models.json.search.ContactsByNumberOCS.setMap, parameter at com.nextcloud.talk.models.json.search.ContactsByNumberOCS.setMap(Unknown Source:2) at com.nextcloud.talk.models.json.search.ContactsByNumberOCS$$JsonObjectMapper.parseField(ContactsByNumberOCS$$JsonObjectMapper.java:56) at com.nextcloud.talk.models.json.search.ContactsByNumberOCS$$JsonObjectMapper.parse(ContactsByNumberOCS$$JsonObjectMapper.java:33) at com.nextcloud.talk.models.json.search.ContactsByNumberOCS$$JsonObjectMapper.parse(ContactsByNumberOCS$$JsonObjectMapper.java:16) at com.nextcloud.talk.models.json.search.ContactsByNumberOverall$$JsonObjectMapper.parseField(ContactsByNumberOverall$$JsonObjectMapper.java:40) at com.nextcloud.talk.models.json.search.ContactsByNumberOverall$$JsonObjectMapper.parse(ContactsByNumberOverall$$JsonObjectMapper.java:30) at com.nextcloud.talk.models.json.search.ContactsByNumberOverall$$JsonObjectMapper.parse(ContactsByNumberOverall$$JsonObjectMapper.java:13) at com.bluelinelabs.logansquare.JsonMapper.parse(JsonMapper.java:52) at com.bluelinelabs.logansquare.LoganSquare.parse(LoganSquare.java:69) at com.github.aurae.retrofit2.LoganSquareResponseBodyConverter.convert(LoganSquareResponseBodyConverter.java:30) at com.github.aurae.retrofit2.LoganSquareResponseBodyConverter.convert(LoganSquareResponseBodyConverter.java:16) at retrofit2.OkHttpCall.parseResponse(OkHttpCall.java:243) at retrofit2.OkHttpCall.execute(OkHttpCall.java:204) at retrofit2.adapter.rxjava2.CallExecuteObservable.subscribeActual(CallExecuteObservable.java:46) at io.reactivex.Observable.subscribe(Observable.java:12284) at retrofit2.adapter.rxjava2.BodyObservable.subscribeActual(BodyObservable.java:35) at io.reactivex.Observable.subscribe(Observable.java:12284) at io.reactivex.internal.operators.observable.ObservableSubscribeOn$SubscribeTask.run(ObservableSubscribeOn.java:96) at io.reactivex.Scheduler$DisposeTask.run(Scheduler.java:608) at io.reactivex.internal.schedulers.ScheduledRunnable.run(ScheduledRunnable.java:66) at io.reactivex.internal.schedulers.ScheduledRunnable.call(ScheduledRunnable.java:57) at java.util.concurrent.FutureTask.run(FutureTask.java:266) at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:301) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641) at java.lang.Thread.run(Thread.java:919) Signed-off-by: Marcel Hibbe --- .../nextcloud/talk/models/json/search/ContactsByNumberOCS.kt | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/app/src/main/java/com/nextcloud/talk/models/json/search/ContactsByNumberOCS.kt b/app/src/main/java/com/nextcloud/talk/models/json/search/ContactsByNumberOCS.kt index 4e6709ff2..9df294a3c 100644 --- a/app/src/main/java/com/nextcloud/talk/models/json/search/ContactsByNumberOCS.kt +++ b/app/src/main/java/com/nextcloud/talk/models/json/search/ContactsByNumberOCS.kt @@ -25,7 +25,6 @@ import android.os.Parcelable import com.bluelinelabs.logansquare.annotation.JsonField import com.bluelinelabs.logansquare.annotation.JsonObject import com.nextcloud.talk.models.json.generic.GenericMeta -import java.util.HashMap import kotlinx.parcelize.Parcelize @Parcelize @@ -34,7 +33,7 @@ data class ContactsByNumberOCS( @JsonField(name = ["meta"]) var meta: GenericMeta?, @JsonField(name = ["data"]) - var map: Map = HashMap() + var map: Map? = HashMap() ) : Parcelable { // This constructor is added to work with the 'com.bluelinelabs.logansquare.annotation.JsonObject' constructor() : this(null, HashMap())