diff --git a/src/main/java/eu/siacs/conversations/persistance/FileBackend.java b/src/main/java/eu/siacs/conversations/persistance/FileBackend.java index 3393c6b0bc01f964748fa95766cc6057ffa5ecc2..12fb829116d6ecd97152ff724cc699ab0b37111e 100644 --- a/src/main/java/eu/siacs/conversations/persistance/FileBackend.java +++ b/src/main/java/eu/siacs/conversations/persistance/FileBackend.java @@ -1339,6 +1339,15 @@ public class FileBackend { int height = drawable.getIntrinsicHeight(); if (height < 1) height = bounds == null || bounds.bottom < 1 ? 256 : bounds.bottom; + if (width < 1) { + Log.w(Config.LOGTAG, "Drawable with no width: " + drawable); + width = 48; + } + if (height < 1) { + Log.w(Config.LOGTAG, "Drawable with no height: " + drawable); + height = 48; + } + bitmap = Bitmap.createBitmap(width, height, Bitmap.Config.ARGB_8888); Canvas canvas = new Canvas(bitmap); drawable.setBounds(0, 0, canvas.getWidth(), canvas.getHeight());