title: Attempt to invoke virtual method 'android.graphics.Rect android.graphics.drawable.Drawable.getBounds()' on a null object reference
body: <p>I have the following code:</p>
  
  <pre><code>etEmail.setOnTouchListener((view, motionEvent) -&gt; {
      final int DRAWABLE_RIGHT = 2;
      if (motionEvent.getAction() == MotionEvent.ACTION_UP) {
          if(motionEvent.getRawX() &gt;= (etEmail.getRight() - etEmail.getCompoundDrawables()[DRAWABLE_RIGHT].getBounds().width())) {
              Utils.getInstance().showPopup("...",MainActivity.this,null);
              return true;
          }
      }
      return false;
  });
  </code></pre>
  
  <p>While generally it seems to work, I suddenly got a crashlytics report saying:</p>
  
  <blockquote>
    <p>Attempt to invoke virtual method 'android.graphics.Rect
    android.graphics.drawable.Drawable.getBounds()' on a null object
    reference</p>
  </blockquote>
  
  <p>for  Brand: Xiaomi, Model: Redmi Note 6 Pro, Android: 9.</p>
  
  <p>Has anyone here have an idea what can cause the drawable to "disappear" or be considered as null?</p>
  
  <p>XML layout:</p>
  
  <pre><code>    &lt;EditText
          android:id="@+id/etEmail"
          tools:ignore="Autofill"
          android:inputType="textEmailAddress"
          android:layout_width="match_parent"
          android:layout_height="wrap_content"
          android:drawableEnd="@drawable/ic_info"
          android:paddingEnd="12dp"
          android:paddingStart="10dp"
          android:textAppearance="@style/TextAppearance.AppCompat.Medium" /&gt;
  </code></pre>