mirror of
https://github.com/M66B/FairEmail.git
synced 2025-02-24 23:12:55 +00:00
Prevent crash
This commit is contained in:
parent
b1aeedb115
commit
6b31b76479
1 changed files with 54 additions and 38 deletions
|
@ -1828,6 +1828,8 @@ public class StyleHelper {
|
||||||
.replace("'", "")
|
.replace("'", "")
|
||||||
.replace("\"", ""));
|
.replace("\"", ""));
|
||||||
|
|
||||||
|
try {
|
||||||
|
|
||||||
if (faces.contains("fairemail"))
|
if (faces.contains("fairemail"))
|
||||||
return ResourcesCompat.getFont(context.getApplicationContext(), R.font.fantasy);
|
return ResourcesCompat.getFont(context.getApplicationContext(), R.font.fantasy);
|
||||||
|
|
||||||
|
@ -1875,6 +1877,20 @@ public class StyleHelper {
|
||||||
if (!tf.equals(Typeface.DEFAULT))
|
if (!tf.equals(Typeface.DEFAULT))
|
||||||
return tf;
|
return tf;
|
||||||
}
|
}
|
||||||
|
} catch (Throwable ex) {
|
||||||
|
Log.e(ex);
|
||||||
|
/*
|
||||||
|
java.lang.NullPointerException: Attempt to invoke virtual method 'java.lang.Object java.lang.reflect.Constructor.newInstance(java.lang.Object[])' on a null object reference
|
||||||
|
at androidx.core.graphics.TypefaceCompatApi21Impl.newFamily(SourceFile:9)
|
||||||
|
at androidx.core.graphics.TypefaceCompatApi21Impl.createFromFontFamilyFilesResourceEntry(SourceFile:1)
|
||||||
|
at androidx.core.graphics.TypefaceCompat.createFromResourcesFamilyXml(SourceFile:86)
|
||||||
|
at androidx.core.content.res.ResourcesCompat.loadFont(SourceFile:17)
|
||||||
|
at androidx.core.content.res.ResourcesCompat.loadFont(SourceFile:3)
|
||||||
|
at androidx.core.content.res.ResourcesCompat.getFont(SourceFile:2)
|
||||||
|
at eu.faircode.email.StyleHelper.getTypeface(SourceFile:316)
|
||||||
|
at eu.faircode.email.StyleHelper.getTypefaceSpan(SourceFile:7)
|
||||||
|
*/
|
||||||
|
}
|
||||||
|
|
||||||
return Typeface.DEFAULT;
|
return Typeface.DEFAULT;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue