Fix flawed logic in verbosity enable method
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
Bea 2023-01-24 14:45:44 +01:00
parent 9f52e8747c
commit 06b28aac70

View File

@ -98,20 +98,16 @@ public class Cache
{
verbose = v;
if(verbosityLogger != null)
{
HidekoBot.getAPI().removeEventListener(verbosityLogger);
verbosityLogger = null;
}
if(v)
{
if(verbosityLogger == null)
{
verbosityLogger = new MessageLogger();
}
verbosityLogger = new MessageLogger();
HidekoBot.getAPI().addEventListener(verbosityLogger);
} else {
if(verbosityLogger != null)
{
HidekoBot.getAPI().removeEventListener(verbosityLogger);
verbosityLogger = null;
}
}
}