Suppressed warning

There seems to be a bug in the kotlin plugin as it tells you when building that this can't be null:
"Condition 'throwable != null' is always 'true'"
However it can indeed be null as seen in https://github.com/TeamNewPipe/NewPipe/pull/6986#issuecomment-906822218
This commit is contained in:
litetex 2021-08-27 16:32:59 +02:00
parent b061423847
commit f18a7c91ca
1 changed files with 6 additions and 0 deletions

View File

@ -300,6 +300,12 @@ class FeedLoadService : Service() {
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
.subscribe { _, throwable ->
// There seems to be a bug in the kotlin plugin as it tells you when
// building that this can't be null:
// "Condition 'throwable != null' is always 'true'"
// However it can indeed be null
// The suppression may be removed in further versions
@Suppress("SENSELESS_COMPARISON")
if (throwable != null) {
Log.e(TAG, "Error while storing result", throwable)
handleError(throwable)