mirror of
https://github.com/M66B/FairEmail.git
synced 2024-12-22 15:55:57 +00:00
Prevent crash
This commit is contained in:
parent
497c6bc221
commit
5b3bafbd0c
1 changed files with 14 additions and 1 deletions
|
@ -158,7 +158,20 @@ class ImageHelper {
|
|||
Paint paint = new Paint();
|
||||
paint.setColor(lum < t ? Color.WHITE : Color.BLACK);
|
||||
paint.setTextSize(size / 2f);
|
||||
paint.setTypeface(Typeface.DEFAULT_BOLD);
|
||||
try {
|
||||
paint.setTypeface(Typeface.DEFAULT_BOLD);
|
||||
} catch (Throwable ex) {
|
||||
Log.e(ex);
|
||||
/*
|
||||
java.lang.NullPointerException: Attempt to invoke interface method 'android.graphics.Typeface miui.util.font.IFontManager.getBaseFont(int)' on a null object reference
|
||||
at miui.util.TypefaceUtils.updateDefaultFont(TypefaceUtils.java:190)
|
||||
at miui.util.TypefaceUtils.loadFontManager(TypefaceUtils.java:168)
|
||||
at miui.util.TypefaceUtils.loadFontSettings(TypefaceUtils.java:64)
|
||||
at miui.util.TypefaceUtils.useVarFont(TypefaceUtils.java:107)
|
||||
at android.graphics.Paint.useMiuiVarFont(Paint.java:1460)
|
||||
at android.graphics.Paint.setTypeface(Paint.java:1443)
|
||||
*/
|
||||
}
|
||||
|
||||
canvas.drawText(letter,
|
||||
size / 2f - paint.measureText(letter) / 2,
|
||||
|
|
Loading…
Reference in a new issue