diff --git a/brut.apktool/apktool-lib/src/main/java/brut/androlib/res/decoder/Res9patchStreamDecoder.java b/brut.apktool/apktool-lib/src/main/java/brut/androlib/res/decoder/Res9patchStreamDecoder.java index 472f8524..1a470907 100644 --- a/brut.apktool/apktool-lib/src/main/java/brut/androlib/res/decoder/Res9patchStreamDecoder.java +++ b/brut.apktool/apktool-lib/src/main/java/brut/androlib/res/decoder/Res9patchStreamDecoder.java @@ -62,6 +62,11 @@ public class Res9patchStreamDecoder implements ResStreamDecoder { ImageIO.write(im2, "png", out); } catch (IOException ex) { throw new AndrolibException(ex); + } catch (NullPointerException ex) { + // In my case this was triggered because a .png file was + // containing a html document instead of an image. + // This could be more verbose and try to MIME ? + throw new AndrolibException(ex); } }