title: Why value I'm trying to invoke method setVisibility() is null?
body: <p>I have this stack trace from <code>Firebase Craslytics</code>:</p>
  
  <blockquote>
    <p>Fatal Exception: java.lang.NullPointerException Attempt to invoke
    virtual method 'void android.widget.ImageView.setVisibility(int)' on a
    null object reference
    com.accenture.vrmobile.BaseActivity.setDrawerVisibility(BaseActivity.java:497)</p>
  </blockquote>
  
  <p>It's reporting crash in this method: </p>
  
  <pre><code>    public void setDrawerVisibility(Boolean visible) {
      if (mButtonActionBarLeft == null)
          mButtonActionBarLeft = (ImageView) findViewById(R.id.button_actionbar_left);
      if (mButtonActionBarRight == null)
          mButtonActionBarRight = (ImageView) findViewById(R.id.button_actionbar_right);
      if (visible) {
          mButtonActionBarLeft.setVisibility(View.VISIBLE); //crashes at this line
          mButtonActionBarRight.setVisibility(View.VISIBLE);
      } else {
          mButtonActionBarLeft.setVisibility(View.INVISIBLE);
          mButtonActionBarRight.setVisibility(View.INVISIBLE);
      }
  }
  </code></pre>
  
  <p>I had this crash before, so I added these lines to the method: </p>
  
  <pre><code>if (mButtonActionBarLeft == null)
          mButtonActionBarLeft = (ImageView) findViewById(R.id.button_actionbar_left);
      if (mButtonActionBarRight == null)
          mButtonActionBarRight = (ImageView) findViewById(R.id.button_actionbar_right);
  </code></pre>
  
  <p>But it's still crashing and reporting <code>nullPointerException</code>. mButtonActionBarLeft and mButtonActionBarRight are buttons that opens/closes navigation drawer.
  I have no idea why is this happening. Maybe someone has experience with this? 
  Thank you!</p>
  
  <p>P.S. I was never able to reproduce this crash, it happens really rarely. I only have stack trace from <code>Firebase</code>.    </p>