fix(reader): Fix potential NPE

This commit is contained in:
Ahmad Ansori Palembani 2024-12-04 06:01:14 +07:00
parent 6df9e4f745
commit 19ea7cbebd
Signed by: null2264
GPG key ID: BA64F8B60AF3EFB6

View file

@ -356,8 +356,8 @@ class ReaderActivity : BaseActivity<ReaderActivityBinding>() {
if (viewModel.needsInit()) {
fromUrl = handleIntentAction(intent)
if (!fromUrl) {
val manga = intent.extras!!.getLong("manga", -1)
val chapter = intent.extras!!.getLong("chapter", -1)
val manga = intent.extras?.getLong("manga", -1L) ?: -1L
val chapter = intent.extras?.getLong("chapter", -1L) ?: -1L
if (manga == -1L || chapter == -1L) {
finish()
return