Browse Source

Prevent crash

main
M66B 6 years ago
parent
commit
437f24d830
1 changed files with 5 additions and 1 deletions
  1. +5
    -1
      app/src/main/java/eu/faircode/email/AdapterMessage.java

+ 5
- 1
app/src/main/java/eu/faircode/email/AdapterMessage.java View File

@ -627,7 +627,11 @@ public class AdapterMessage extends PagedListAdapter<TupleMessageEx, AdapterMess
} else {
File file = EntityAttachment.getFile(context, attachment.id);
Drawable d = Drawable.createFromPath(file.getAbsolutePath());
d.setBounds(0, 0, d.getIntrinsicWidth(), d.getIntrinsicHeight());
if (d == null) {
d = context.getResources().getDrawable(R.drawable.baseline_warning_24, context.getTheme());
d.setBounds(0, 0, px, px);
} else
d.setBounds(0, 0, d.getIntrinsicWidth(), d.getIntrinsicHeight());
return d;
}
}


Loading…
Cancel
Save