diff --git a/app/src/main/java/io/legado/app/data/entities/RssArticle.kt b/app/src/main/java/io/legado/app/data/entities/RssArticle.kt index c9d7edcf7..e3810036f 100644 --- a/app/src/main/java/io/legado/app/data/entities/RssArticle.kt +++ b/app/src/main/java/io/legado/app/data/entities/RssArticle.kt @@ -10,7 +10,7 @@ import androidx.room.Ignore ) data class RssArticle( var origin: String = "", - var title: String? = "", + var title: String = "", var order: Long = 0, var author: String? = null, var link: String? = null, diff --git a/app/src/main/java/io/legado/app/ui/rss/read/ReadRssViewModel.kt b/app/src/main/java/io/legado/app/ui/rss/read/ReadRssViewModel.kt index 7310b819f..db4191674 100644 --- a/app/src/main/java/io/legado/app/ui/rss/read/ReadRssViewModel.kt +++ b/app/src/main/java/io/legado/app/ui/rss/read/ReadRssViewModel.kt @@ -16,8 +16,10 @@ class ReadRssViewModel(application: Application) : BaseViewModel(application) { fun initData(intent: Intent) { execute { - intent.getStringExtra("guid")?.let { - val rssArticle = App.db.rssArtivleDao().get(it) + val origin = intent.getStringExtra("origin") + val title = intent.getStringExtra("title") + if (origin != null && title != null) { + val rssArticle = App.db.rssArtivleDao().get(origin, title) if (rssArticle != null) { if (!rssArticle.description.isNullOrBlank()) { contentLiveData.postValue(rssArticle.description)