title: NullPointerException in android.view.GLES20RecordingCanvas
body: <p>I'm seeing NullPointerException crash reports in android.view.GLES20RecordingCanvas.drawPatch() </p>
  
  <p>The Android source is here <a href="http://grepcode.com/file/repository.grepcode.com/java/ext/com.google.android/android/4.0.1_r1/android/view/GLES20RecordingCanvas.java" rel="nofollow">http://grepcode.com/file/repository.grepcode.com/java/ext/com.google.android/android/4.0.1_r1/android/view/GLES20RecordingCanvas.java</a></p>
  
  <p>Seems to be crashing at line 97 for 4.0.x only, when the activity has hardware acceleration on. </p>
  
  <p>Stack trace:</p>
  
  <pre><code>java.lang.NullPointerException
  at android.view.GLES20RecordingCanvas.drawPatch(GLES20RecordingCanvas.java:97)
  at android.graphics.NinePatch.draw(NinePatch.java:125)
  at android.graphics.drawable.NinePatchDrawable.draw(NinePatchDrawable.java:189)
  at android.widget.ScrollBarDrawable.drawThumb(ScrollBarDrawable.java:178)
  at android.widget.ScrollBarDrawable.draw(ScrollBarDrawable.java:137)
  at android.view.View.onDrawVerticalScrollBar(View.java:9532)
  at android.view.View.onDrawScrollBars(View.java:9476)
  at android.view.View.draw(View.java:11091)
  at android.widget.AbsListView.draw(AbsListView.java:3428)
  at android.view.View.getDisplayList(View.java:10455)
  at android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:2605)
  at android.view.View.getDisplayList(View.java:10418)
  at android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:2605)
  at android.view.View.getDisplayList(View.java:10418)
  at android.view.ViewGroup.drawChild(ViewGroup.java:2858)
  at android.view.ViewGroup.dispatchDraw(ViewGroup.java:2497)
  at android.view.View.draw(View.java:11067)
  at android.view.View.getDisplayList(View.java:10455)
  at android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:2605)
  at android.view.View.getDisplayList(View.java:10418)
  at android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:2605)
  at android.view.View.getDisplayList(View.java:10418)
  at android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:2605)
  at android.view.View.getDisplayList(View.java:10418)
  at android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:2605)
  at android.view.View.getDisplayList(View.java:10418)
  at android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:2605)
  at android.view.View.getDisplayList(View.java:10418)
  at android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:2605)
  at android.view.View.getDisplayList(View.java:10418)
  at android.view.HardwareRenderer$GlRenderer.draw(HardwareRenderer.java:879)
  at android.view.ViewRootImpl.draw(ViewRootImpl.java:1955)
  at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:1661)
  at android.view.ViewRootImpl.handleMessage(ViewRootImpl.java:2505)
  at android.os.Handler.dispatchMessage(Handler.java:99)
  at android.os.Looper.loop(Looper.java:154)
  at android.app.ActivityThread.main(ActivityThread.java:4945)
  at java.lang.reflect.Method.invokeNative(Native Method)
  at java.lang.reflect.Method.invoke(Method.java:511)
  at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:784)
  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:551)
  at dalvik.system.NativeStart.main(Native Method)
  </code></pre>
  
  <p>Is there an easy fix for this, or do I need to just turn off hardware acceleration for the affected activity?</p>