Skip to content

Commit b12d675

Browse files
committed
Do not create more than one Konsumer object to guess RSS type (fixes #246)
1 parent 1056f90 commit b12d675

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

api/src/main/java/com/readrops/api/localfeed/LocalRSSDataSource.kt

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -111,8 +111,7 @@ class LocalRSSDataSource(private val httpClient: OkHttpClient) : KoinComponent {
111111
// if we can't guess type based on content-type header, we use the content
112112
if (type == LocalRSSHelper.RSSType.UNKNOWN) {
113113
try {
114-
konsumer = response.body!!.byteStream().konsumeXml()
115-
rootKonsumer = konsumer.nextElement(LocalRSSHelper.RSS_ROOT_NAMES)
114+
rootKonsumer = konsumer?.nextElement(LocalRSSHelper.RSS_ROOT_NAMES)
116115

117116
if (rootKonsumer != null) {
118117
type = LocalRSSHelper.guessRSSType(rootKonsumer)

0 commit comments

Comments
 (0)