LociStar / Organizer

A configurable multipurpose bot bringing you organizing commands, multiplayer games, moderation commands and more!
1 stars 0 forks source link

Fix event scheduler #77

Closed LociStar closed 2 years ago

LociStar commented 2 years ago

If user is registered to bot and wants to schedule an event, the user will receive an error.

17:34:04.233 ERROR [boundedElastic-9/locibot]: {Guild ID: 712377054531944510} [event schedule] An unknown error occurred: Cannot invoke "java.lang.Long.longValue()" because the return value of "com.locibot.locibot.database.events_db.bean.DBEventBean.getScheduledDate()" is null

Possible{ApplicationCommandInteractionData{id=Possible{942742961937080342}, name=Possible{event}, type=Possible{1}, resolved=Possible.absent, options=[ApplicationCommandInteractionOptionData{name=schedule, value=Possible.absent, type=1, options=[ApplicationCommandInteractionOptionData{name=event_title, value=Possible{test}, type=3, options=null}, ApplicationCommandInteractionOptionData{name=date, value=Possible{19.04.2022}, type=3, options=null}, ApplicationCommandInteractionOptionData{name=time, value=Possible{18:00}, type=3, options=null}]}], customId=Possible.absent, componentType=Possible.absent, values=null, targetId=Possible.absent}}
java.lang.NullPointerException: Cannot invoke "java.lang.Long.longValue()" because the return value of "com.locibot.locibot.database.events_db.bean.DBEventBean.getScheduledDate()" is null
    at com.locibot.locibot.command.event_commands.EventUtil.lambda$privateInvite$1(EventUtil.java:60)
    Suppressed: reactor.core.publisher.FluxOnAssembly$OnAssemblyException: 
Assembly trace from producer [reactor.core.publisher.MonoFlatMap] :
    reactor.core.publisher.Mono.flatMap(Mono.java:3047)
    com.locibot.locibot.command.event_commands.EventUtil.lambda$privateInvite$2(EventUtil.java:51)
Error has been observed at the following site(s):
    |_     Mono.flatMap ⇢ at com.locibot.locibot.command.event_commands.EventUtil.lambda$privateInvite$2(EventUtil.java:51)
    |_     Mono.flatMap ⇢ at com.locibot.locibot.command.event_commands.EventUtil.privateInvite(EventUtil.java:50)
    |_     Mono.flatMap ⇢ at com.locibot.locibot.command.event_commands.ScheduleEventCmd.lambda$execute$4(ScheduleEventCmd.java:44)
    |_     Mono.flatMap ⇢ at com.locibot.locibot.command.event_commands.ScheduleEventCmd.lambda$execute$5(ScheduleEventCmd.java:44)
    |_   Flux.concatMap ⇢ at com.locibot.locibot.command.event_commands.ScheduleEventCmd.lambda$execute$8(ScheduleEventCmd.java:43)
    |_ Flux.collectList ⇢ at com.locibot.locibot.command.event_commands.ScheduleEventCmd.lambda$execute$8(ScheduleEventCmd.java:55)
    |_        Mono.then ⇢ at com.locibot.locibot.command.event_commands.ScheduleEventCmd.lambda$execute$8(ScheduleEventCmd.java:43)
    |_        Mono.then ⇢ at com.locibot.locibot.command.event_commands.ScheduleEventCmd.lambda$execute$8(ScheduleEventCmd.java:57)
    |_     Mono.flatMap ⇢ at com.locibot.locibot.command.event_commands.ScheduleEventCmd.lambda$execute$8(ScheduleEventCmd.java:58)
    |_     Mono.flatMap ⇢ at com.locibot.locibot.command.event_commands.ScheduleEventCmd.execute(ScheduleEventCmd.java:38)
    |_        Mono.then ⇢ at com.locibot.locibot.command.event_commands.ScheduleEventCmd.execute(ScheduleEventCmd.java:37)
    |_     Mono.flatMap ⇢ at com.locibot.locibot.core.command.CommandProcessor.executeCommand(CommandProcessor.java:80)
    |_ Mono.doOnSuccess ⇢ at com.locibot.locibot.core.command.CommandProcessor.executeCommand(CommandProcessor.java:81)
Stack trace:
        at com.locibot.locibot.command.event_commands.EventUtil.lambda$privateInvite$1(EventUtil.java:60)
        at reactor.core.publisher.MonoFlatMap$FlatMapMain.onNext(MonoFlatMap.java:125)
        at reactor.core.publisher.FluxSwitchIfEmpty$SwitchIfEmptySubscriber.onNext(FluxSwitchIfEmpty.java:74)
        at reactor.core.publisher.MonoPeekTerminal$MonoTerminalPeekSubscriber.onNext(MonoPeekTerminal.java:180)
        at reactor.core.publisher.FluxMapFuseable$MapFuseableConditionalSubscriber.onNext(FluxMapFuseable.java:295)
        at reactor.core.publisher.MonoPublishOn$PublishOnSubscriber.run(MonoPublishOn.java:181)
        at reactor.core.scheduler.SchedulerTask.call(SchedulerTask.java:68)
        at reactor.core.scheduler.SchedulerTask.call(SchedulerTask.java:28)
        at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
        at java.base/java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:304)
        at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)
        at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
        at java.base/java.lang.Thread.run(Thread.java:833)
LociStar commented 2 years ago

closed with commit 5a2ad8d25c52360033604c3941181d654eeaf902 (fixed with version 3.0.6)