Fix failures on NullPointerExceptions
This commit is contained in:
parent
dac70bfd35
commit
51fd7ef228
2 changed files with 24 additions and 15 deletions
2
pom.xml
2
pom.xml
|
@ -4,7 +4,7 @@
|
|||
<modelVersion>4.0.0</modelVersion>
|
||||
<groupId>loper</groupId>
|
||||
<artifactId>InnaIrcBot</artifactId>
|
||||
<version>0.8-SNAPSHOT</version>
|
||||
<version>0.9-SNAPSHOT</version>
|
||||
|
||||
<packaging>jar</packaging>
|
||||
<name>InnaIrcBot</name>
|
||||
|
|
|
@ -104,26 +104,35 @@ public class ConfigurationFile {
|
|||
if (channelRules == null)
|
||||
channelRules = new ArrayList<>();
|
||||
|
||||
Ini.Section joinFloodControlSection = channelSection.getChild("JoinFloodControl");
|
||||
|
||||
boolean joinFloodControl = joinFloodControlSection.get("enable", boolean.class);
|
||||
boolean joinFloodControl = false;
|
||||
int joinFloodControlEventsNumber = -1;
|
||||
int joinFloodControlTimeFrame = -1;
|
||||
try {
|
||||
Ini.Section joinFloodControlSection = channelSection.getChild("JoinFloodControl");
|
||||
|
||||
joinFloodControl = joinFloodControlSection.get("enable", boolean.class);
|
||||
joinFloodControlEventsNumber = -1;
|
||||
joinFloodControlTimeFrame = -1;
|
||||
if (joinFloodControl){
|
||||
joinFloodControlEventsNumber = joinFloodControlSection.get("join number", int.class);
|
||||
joinFloodControlTimeFrame = joinFloodControlSection.get("time frame", int.class);
|
||||
}
|
||||
} catch (NullPointerException ignore) {}
|
||||
|
||||
Ini.Section joinCloneControlSection = channelSection.getChild("JoinCloneControl");
|
||||
|
||||
boolean joinCloneControl = joinCloneControlSection.get("enable", boolean.class);
|
||||
|
||||
boolean joinCloneControl = false;
|
||||
int joinCloneControlTimeFrame = -1;
|
||||
String joinCloneControlPattern = "";
|
||||
try {
|
||||
Ini.Section joinCloneControlSection = channelSection.getChild("JoinCloneControl");
|
||||
|
||||
joinCloneControl = joinCloneControlSection.get("enable", boolean.class);
|
||||
joinCloneControlTimeFrame = -1;
|
||||
joinCloneControlPattern = "";
|
||||
if (joinCloneControl){
|
||||
joinCloneControlTimeFrame = joinCloneControlSection.get("time frame", int.class);
|
||||
joinCloneControlPattern = joinCloneControlSection.getOrDefault("pattern", "");
|
||||
}
|
||||
} catch (NullPointerException ignore) {}
|
||||
|
||||
Profile.Section parseLinksTitlesSection = channelSection.getChild("ParseLinksTitles");
|
||||
|
||||
|
|
Loading…
Reference in a new issue