[app] Allow runOffUiThread() to return null

This commit is contained in:
Torsten Grote
2022-09-23 17:35:35 -03:00
committed by Hans-Christoph Steiner
parent 367e9e9d0c
commit ec69bc00a7

View File

@@ -835,7 +835,10 @@ public final class Utils {
return Single.fromCallable(supplier::get)
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
.subscribe(consumer::accept);
.subscribe(consumer::accept, e -> {
Log.e(TAG, "Could not run off UI thread: ", e);
consumer.accept(null);
});
}
public static Disposable runOffUiThread(Runnable runnable) {