Ensure that the context is non-null when loading the shownotes (#6327)
This commit is contained in:
parent
5b6fe580e0
commit
4e1a3be122
|
@ -1,6 +1,7 @@
|
||||||
package de.danoeh.antennapod.fragment;
|
package de.danoeh.antennapod.fragment;
|
||||||
|
|
||||||
import android.app.Activity;
|
import android.app.Activity;
|
||||||
|
import android.content.Context;
|
||||||
import android.content.SharedPreferences;
|
import android.content.SharedPreferences;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
import android.util.Log;
|
import android.util.Log;
|
||||||
|
@ -86,6 +87,10 @@ public class ItemDescriptionFragment extends Fragment {
|
||||||
if (webViewLoader != null) {
|
if (webViewLoader != null) {
|
||||||
webViewLoader.dispose();
|
webViewLoader.dispose();
|
||||||
}
|
}
|
||||||
|
Context context = getContext();
|
||||||
|
if (context == null) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
webViewLoader = Maybe.<String>create(emitter -> {
|
webViewLoader = Maybe.<String>create(emitter -> {
|
||||||
Playable media = controller.getMedia();
|
Playable media = controller.getMedia();
|
||||||
if (media == null) {
|
if (media == null) {
|
||||||
|
@ -100,7 +105,7 @@ public class ItemDescriptionFragment extends Fragment {
|
||||||
DBReader.loadDescriptionOfFeedItem(feedMedia.getItem());
|
DBReader.loadDescriptionOfFeedItem(feedMedia.getItem());
|
||||||
}
|
}
|
||||||
ShownotesCleaner shownotesCleaner = new ShownotesCleaner(
|
ShownotesCleaner shownotesCleaner = new ShownotesCleaner(
|
||||||
getActivity(), media.getDescription(), media.getDuration());
|
context, media.getDescription(), media.getDuration());
|
||||||
emitter.onSuccess(shownotesCleaner.processShownotes());
|
emitter.onSuccess(shownotesCleaner.processShownotes());
|
||||||
})
|
})
|
||||||
.subscribeOn(Schedulers.io())
|
.subscribeOn(Schedulers.io())
|
||||||
|
|
Loading…
Reference in New Issue