diff --git a/twidere/src/main/kotlin/org/mariotaku/twidere/activity/MediaViewerActivity.kt b/twidere/src/main/kotlin/org/mariotaku/twidere/activity/MediaViewerActivity.kt index 566e4b9ef..dc3532500 100644 --- a/twidere/src/main/kotlin/org/mariotaku/twidere/activity/MediaViewerActivity.kt +++ b/twidere/src/main/kotlin/org/mariotaku/twidere/activity/MediaViewerActivity.kt @@ -283,14 +283,10 @@ class MediaViewerActivity : BaseActivity(), IExtendedActivity, ATEToolbarCustomi return 0 } - fun hasStatus(): Boolean { - return intent.hasExtra(EXTRA_STATUS) - } - - private val status: ParcelableStatus + private val status: ParcelableStatus? get() = intent.getParcelableExtra(EXTRA_STATUS) - private val initialMedia: ParcelableMedia + private val initialMedia: ParcelableMedia? get() = intent.getParcelableExtra(EXTRA_CURRENT_MEDIA) private val media: Array by lazy { @@ -298,8 +294,7 @@ class MediaViewerActivity : BaseActivity(), IExtendedActivity, ATEToolbarCustomi } protected fun processShareIntent(intent: Intent) { - if (!hasStatus()) return - val status = status + val status = status ?: return intent.putExtra(Intent.EXTRA_SUBJECT, IntentUtils.getStatusShareSubject(this, status)) intent.putExtra(Intent.EXTRA_TEXT, IntentUtils.getStatusShareText(this, status)) }