fixed NPE

This commit is contained in:
Mariotaku Lee 2017-01-25 12:15:54 +08:00
parent 3c8aac4955
commit e481f56b65
No known key found for this signature in database
GPG Key ID: 15C10F89D7C33535
2 changed files with 8 additions and 3 deletions

View File

@ -47,9 +47,12 @@ import org.mariotaku.twidere.adapter.decorator.DividerItemDecoration
import org.mariotaku.twidere.adapter.iface.ILoadMoreSupportAdapter
import org.mariotaku.twidere.annotation.ReadPositionTag
import org.mariotaku.twidere.annotation.Referral
import org.mariotaku.twidere.constant.*
import org.mariotaku.twidere.constant.IntentConstants.*
import org.mariotaku.twidere.constant.KeyboardShortcutConstants.*
import org.mariotaku.twidere.constant.displaySensitiveContentsKey
import org.mariotaku.twidere.constant.newDocumentApiKey
import org.mariotaku.twidere.constant.readFromBottomKey
import org.mariotaku.twidere.constant.rememberPositionKey
import org.mariotaku.twidere.extension.model.getAccountType
import org.mariotaku.twidere.graphic.like.LikeAnimationDrawable
import org.mariotaku.twidere.loader.iface.IExtendedLoader
@ -403,7 +406,8 @@ abstract class AbsStatusesFragment protected constructor() :
override fun onQuotedStatusClick(holder: IStatusViewHolder, position: Int) {
val status = adapter.getStatus(position) ?: return
IntentUtils.openStatus(activity, status.account_key, status.quoted_id)
val quotedId = status.quoted_id ?: return
IntentUtils.openStatus(activity, status.account_key, quotedId)
}
override fun onStatusLongClick(holder: IStatusViewHolder, position: Int): Boolean {

View File

@ -1080,7 +1080,8 @@ class StatusFragment : BaseFragment(), LoaderCallbacks<SingleResponse<Parcelable
IntentUtils.openMap(adapter.context, location.latitude, location.longitude)
}
itemView.quotedView -> {
IntentUtils.openStatus(adapter.context, status.account_key, status.quoted_id)
val quotedId = status.quoted_id ?: return
IntentUtils.openStatus(adapter.context, status.account_key, quotedId)
}
itemView.translateLabel -> {
fragment.loadTranslation(adapter.status)