Fix crash due to null drawable

This commit is contained in:
emanuele-f 2020-01-11 15:05:13 +01:00
parent 55174a3bdb
commit b1da40d478

View File

@ -67,7 +67,7 @@ public class StatusFragment extends Fragment implements AppStateListener {
public boolean onTouch(View v, MotionEvent event) {
Drawable mCollectorInfoDrawable = mCollectorInfo.getCompoundDrawables()[2 /* Right */];
if(event.getAction() == MotionEvent.ACTION_UP) {
if((mCollectorInfoDrawable != null) && (event.getAction() == MotionEvent.ACTION_UP)) {
if(event.getRawX() >= (mCollectorInfo.getRight() - mCollectorInfoDrawable.getBounds().width())) {
Intent intent = new Intent(mActivity, SettingsActivity.class);
startActivity(intent);