Colorpicker: Fix possible NPE
Change-Id: I06628e6fc3ef7651e06b4c03acb048a9bb3e6540
diff --git a/src/com/bliss/support/colorpicker/AlphaPatternDrawable.java b/src/com/bliss/support/colorpicker/AlphaPatternDrawable.java
index 288c124..3649b5f 100644
--- a/src/com/bliss/support/colorpicker/AlphaPatternDrawable.java
+++ b/src/com/bliss/support/colorpicker/AlphaPatternDrawable.java
@@ -54,7 +54,9 @@
@Override
public void draw(Canvas canvas) {
- canvas.drawBitmap(mBitmap, null, getBounds(), mPaint);
+ if (mBitmap != null) {
+ canvas.drawBitmap(mBitmap, null, getBounds(), mPaint);
+ }
}
@Override
diff --git a/src/com/bliss/support/colorpicker/ColorPickerPanelView.java b/src/com/bliss/support/colorpicker/ColorPickerPanelView.java
index a6185d1..aa6311d 100644
--- a/src/com/bliss/support/colorpicker/ColorPickerPanelView.java
+++ b/src/com/bliss/support/colorpicker/ColorPickerPanelView.java
@@ -39,7 +39,7 @@
*/
private final static float BORDER_WIDTH_PX = 1;
- private float mDensity = 1f;
+ private static float mDensity = 1f;
private int mBorderColor = 0xff6E6E6E;
private int mColor = 0xff000000;