Prevent crash

pull/212/head
M66B 2 years ago
parent b1aeedb115
commit 6b31b76479

@ -1828,6 +1828,8 @@ public class StyleHelper {
.replace("'", "")
.replace("\"", ""));
try {
if (faces.contains("fairemail"))
return ResourcesCompat.getFont(context.getApplicationContext(), R.font.fantasy);
@ -1875,6 +1877,20 @@ public class StyleHelper {
if (!tf.equals(Typeface.DEFAULT))
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;
}

Loading…
Cancel
Save