Can getDrawable() throw a NullPointerException? : <p>I have a class extending ImageView. In it, I have a function that calls <code>getDrawable().getIntrinsicWidth();</code>. I have about 100 000 installs, and I have 10 reports of this line producing a nullpointerexception. I can't reproduce this, but would still like to fix this. For this, I need to know what throws it, but I can't test it.</p>

<p>Can I safely assume that getDrawable() can not throw a nullpointer exception, but returns null for some reason, so getIntrinsicWidth() throws the exception? </p>

<p>Also, why would it return null, unless it was set to null? I set the image only by from ShareIntents, and I filter by mimetyp "image/*". If the Uri wasn't pointing to an image, wouldn't that get sorted out during the sharing process? Or do I need to take care of that myself?</p>
