fixed crashes when clicking menu icon in status screen

This commit is contained in:
Mariotaku Lee 2015-04-20 00:12:59 +08:00
parent be0c164a1a
commit a11b20467a
1 changed files with 3 additions and 1 deletions

View File

@ -835,8 +835,10 @@ public class StatusFragment extends BaseSupportFragment implements LoaderCallbac
@Override
public boolean onMenuItemClick(MenuItem item) {
final int layoutPosition = getLayoutPosition();
if (layoutPosition < 0) return false;
final StatusFragment fragment = adapter.getFragment();
final ParcelableStatus status = adapter.getStatus(getAdapterPosition());
final ParcelableStatus status = adapter.getStatus(layoutPosition);
if (status == null || fragment == null) return false;
final AsyncTwitterWrapper twitter = fragment.getTwitterWrapper();
final FragmentActivity activity = fragment.getActivity();