Added fail safe

This commit is contained in:
M66B 2021-05-02 09:25:07 +02:00
parent 6e367fb420
commit 476667ee3a
1 changed files with 7 additions and 2 deletions

View File

@ -418,8 +418,13 @@ public class Helper {
}
static boolean canPrint(Context context) {
PackageManager pm = context.getPackageManager();
return pm.hasSystemFeature(PackageManager.FEATURE_PRINTING);
try {
PackageManager pm = context.getPackageManager();
return pm.hasSystemFeature(PackageManager.FEATURE_PRINTING);
} catch (Throwable ex) {
Log.e(ex);
return false;
}
}
static Boolean isIgnoringOptimizations(Context context) {