mirror of
https://github.com/AuthMe/AuthMeReloaded.git
synced 2025-02-23 07:11:30 +01:00
Security - if any Throwable is thrown on initialization AuthMe should shut down
- Found via #1149
This commit is contained in:
parent
7d17608a0b
commit
2070f22968
@ -137,9 +137,9 @@ public class AuthMe extends JavaPlugin {
|
||||
// Initialize the plugin
|
||||
try {
|
||||
initialize();
|
||||
} catch (Exception e) {
|
||||
ConsoleLogger.logException("Aborting initialization of AuthMe:", e);
|
||||
OnStartupTasks.displayLegacyJarHint(e);
|
||||
} catch (Throwable th) {
|
||||
ConsoleLogger.logException("Aborting initialization of AuthMe:", th);
|
||||
OnStartupTasks.displayLegacyJarHint(th);
|
||||
stopOrUnload();
|
||||
return;
|
||||
}
|
||||
|
@ -127,11 +127,11 @@ public class OnStartupTasks {
|
||||
* Displays a hint to use the legacy AuthMe JAR if AuthMe could not be started
|
||||
* because Gson was not found.
|
||||
*
|
||||
* @param e the exception to process
|
||||
* @param th the Throwable to process
|
||||
*/
|
||||
public static void displayLegacyJarHint(Exception e) {
|
||||
if (e instanceof InjectorReflectionException) {
|
||||
Throwable causeOfCause = Optional.of(e)
|
||||
public static void displayLegacyJarHint(Throwable th) {
|
||||
if (th instanceof InjectorReflectionException) {
|
||||
Throwable causeOfCause = Optional.of(th)
|
||||
.map(Throwable::getCause)
|
||||
.map(Throwable::getCause).orElse(null);
|
||||
if (causeOfCause instanceof NoClassDefFoundError
|
||||
|
Loading…
Reference in New Issue
Block a user