From fa4e4cb2bbf4e4bdc7f06e9a9b65b08e1cdf61e7 Mon Sep 17 00:00:00 2001 From: Anthony Calosa Date: Sat, 1 May 2021 13:15:10 +0800 Subject: [PATCH] [Mobile] ExceptionInInitializerError (forge.screens.FScreen in ) - it seems it was trying to draw the bug reporter interface while ending the graphics if sentry is not enabled --- forge-gui-mobile/src/forge/Forge.java | 12 +++++++++--- .../src/main/java/forge/gui/error/BugReporter.java | 2 +- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/forge-gui-mobile/src/forge/Forge.java b/forge-gui-mobile/src/forge/Forge.java index bce25102067..497af30e4e7 100644 --- a/forge-gui-mobile/src/forge/Forge.java +++ b/forge-gui-mobile/src/forge/Forge.java @@ -472,7 +472,9 @@ public class Forge implements ApplicationListener { } catch (Exception ex) { graphics.end(); - BugReporter.reportException(ex); + //check if sentry is enabled, if not it will call the gui interface but here we end the graphics so we only send it via sentry.. + if (BugReporter.isSentryEnabled()) + BugReporter.reportException(ex); } finally { if(dispose) ImageCache.disposeTexture(); @@ -524,7 +526,9 @@ public class Forge implements ApplicationListener { } catch (Exception ex) { graphics.end(); - BugReporter.reportException(ex); + //check if sentry is enabled, if not it will call the gui interface but here we end the graphics so we only send it via sentry.. + if (BugReporter.isSentryEnabled()) + BugReporter.reportException(ex); } if (showFPS) frameRate.render(); @@ -544,7 +548,9 @@ public class Forge implements ApplicationListener { } catch (Exception ex) { graphics.end(); - BugReporter.reportException(ex); + //check if sentry is enabled, if not it will call the gui interface but here we end the graphics so we only send it via sentry.. + if (BugReporter.isSentryEnabled()) + BugReporter.reportException(ex); } } diff --git a/forge-gui/src/main/java/forge/gui/error/BugReporter.java b/forge-gui/src/main/java/forge/gui/error/BugReporter.java index 6a1e0e1d929..b3965239ad9 100644 --- a/forge-gui/src/main/java/forge/gui/error/BugReporter.java +++ b/forge-gui/src/main/java/forge/gui/error/BugReporter.java @@ -98,7 +98,7 @@ public class BugReporter { } } - private static boolean isSentryEnabled() { + public static boolean isSentryEnabled() { return FModel.getPreferences().getPrefBoolean(ForgePreferences.FPref.USE_SENTRY); } /**