Merge pull request #315 from dlew/dlew/fix-npe

Fixed accidentally introduced potential NPE
This commit is contained in:
Phillip Thelen 2015-12-17 15:26:28 +01:00
commit d4c2fc6beb

View file

@ -66,10 +66,9 @@ public class UserPicture {
Bitmap res = Bitmap.createBitmap(WIDTH, HEIGHT, Bitmap.Config.ARGB_8888);
Canvas myCanvas = new Canvas(res);
Integer layerNumber = 0;
for (Object layer : this.layers) {
if (layer.getClass() == Bitmap.class) {
Bitmap layerBitmap = (Bitmap) layer;
this.modifyCanvas(layerBitmap, myCanvas, layerNumber);
for (Bitmap layerBitmap : this.layers) {
if (layerBitmap != null) {
modifyCanvas(layerBitmap, myCanvas, layerNumber);
}
layerNumber++;
}