Skip to content

Commit

Permalink
bugfix: error when CapivaraExceptionHandler is null intentionally
Browse files Browse the repository at this point in the history
  • Loading branch information
FerroEduardo committed Dec 17, 2023
1 parent c0c62a7 commit a54c2c9
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/main/java/com/softawii/capivara/config/SpringConfig.java
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
import net.dv8tion.jda.api.utils.cache.CacheFlag;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
Expand Down Expand Up @@ -92,7 +93,7 @@ public CapivaraExceptionHandler capivaraExceptionHandler() {
}

@Bean
public Curupira curupira(JDA jda, CapivaraExceptionHandler exceptionHandler) {
public Curupira curupira(JDA jda, @Autowired(required = false) CapivaraExceptionHandler exceptionHandler) {
String pkg = "com.softawii.capivara.listeners";
String resetEnv = env.getProperty("curupira.reset", "false");
boolean reset = Boolean.parseBoolean(resetEnv);
Expand Down

0 comments on commit a54c2c9

Please sign in to comment.