PiekJ / jambot

Discord bot for playing music in voice channels.
https://jambot.red
MIT License
4 stars 1 forks source link

NullpointerException on YoutubeAPIService #106

Open carstenflokstra opened 3 months ago

carstenflokstra commented 3 months ago
2024-08-02T19:32:44.548+02:00 ERROR 6 --- [jambot] [inWS-ReadThread] net.dv8tion.jda.api.JDA                  : One of the EventListeners had an uncaught exception

java.lang.NullPointerException: youtubeId is marked non-null but is null
        at dev.joopie.jambot.model.TrackSource.setYoutubeId(TrackSource.java:13) ~[!/:0.0.1-SNAPSHOT]
        at dev.joopie.jambot.service.SearchService.performYoutubeSearch(SearchService.java:30) ~[!/:0.0.1-SNAPSHOT]
        at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:103) ~[na:na]
        at java.base/java.lang.reflect.Method.invoke(Method.java:580) ~[na:na]
        at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:354) ~[spring-aop-6.1.11.jar!/:6.1.11]
        at org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:716) ~[spring-aop-6.1.11.jar!/:6.1.11]
        at dev.joopie.jambot.service.SearchService$$SpringCGLIB$$0.performYoutubeSearch(<generated>) ~[!/:0.0.1-SNAPSHOT]
        at java.base/java.util.Optional.map(Optional.java:260) ~[na:na]
        at dev.joopie.jambot.music.command.PlayCommandHandler.handleSpotifyLink(PlayCommandHandler.java:141) ~[!/:0.0.1-SNAPSHOT]
        at dev.joopie.jambot.music.command.PlayCommandHandler.handle(PlayCommandHandler.java:91) ~[!/:0.0.1-SNAPSHOT]
        at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:103) ~[na:na]
        at java.base/java.lang.reflect.Method.invoke(Method.java:580) ~[na:na]
        at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:354) ~[spring-aop-6.1.11.jar!/:6.1.11]
        at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:196) ~[spring-aop-6.1.11.jar!/:6.1.11]
        at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:163) ~[spring-aop-6.1.11.jar!/:6.1.11]
        at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.proceed(CglibAopProxy.java:768) ~[spring-aop-6.1.11.jar!/:6.1.11]
        at org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:379) ~[spring-tx-6.1.11.jar!/:6.1.11]
        at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:119) ~[spring-tx-6.1.11.jar!/:6.1.11]
        at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:184) ~[spring-aop-6.1.11.jar!/:6.1.11]
        at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.proceed(CglibAopProxy.java:768) ~[spring-aop-6.1.11.jar!/:6.1.11]
        at org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:720) ~[spring-aop-6.1.11.jar!/:6.1.11]
        at dev.joopie.jambot.music.command.PlayCommandHandler$$SpringCGLIB$$0.handle(<generated>) ~[!/:0.0.1-SNAPSHOT]
        at dev.joopie.jambot.music.command.JamCommandHandler.handle(JamCommandHandler.java:36) ~[!/:0.0.1-SNAPSHOT]
        at dev.joopie.jambot.JambotListener.lambda$onSlashCommandInteraction$1(JambotListener.java:111) ~[!/:0.0.1-SNAPSHOT]
        at java.base/java.util.Optional.map(Optional.java:260) ~[na:na]
        at dev.joopie.jambot.JambotListener.onSlashCommandInteraction(JambotListener.java:111) ~[!/:0.0.1-SNAPSHOT]
        at net.dv8tion.jda.api.hooks.ListenerAdapter.onEvent(ListenerAdapter.java:456) ~[JDA-5.0.1.jar!/:5.0.1]
        at net.dv8tion.jda.api.hooks.InterfacedEventManager.handle(InterfacedEventManager.java:98) ~[JDA-5.0.1.jar!/:5.0.1]
        at net.dv8tion.jda.internal.hooks.EventManagerProxy.handleInternally(EventManagerProxy.java:88) ~[JDA-5.0.1.jar!/:5.0.1]
        at net.dv8tion.jda.internal.hooks.EventManagerProxy.handle(EventManagerProxy.java:70) ~[JDA-5.0.1.jar!/:5.0.1]
        at net.dv8tion.jda.internal.JDAImpl.handleEvent(JDAImpl.java:169) ~[JDA-5.0.1.jar!/:5.0.1]
        at net.dv8tion.jda.internal.handle.InteractionCreateHandler.handleCommand(InteractionCreateHandler.java:112) ~[JDA-5.0.1.jar!/:5.0.1]
        at net.dv8tion.jda.internal.handle.InteractionCreateHandler.handleInternally(InteractionCreateHandler.java:83) ~[JDA-5.0.1.jar!/:5.0.1]
        at net.dv8tion.jda.internal.handle.SocketHandler.handle(SocketHandler.java:39) ~[JDA-5.0.1.jar!/:5.0.1]
        at net.dv8tion.jda.internal.requests.WebSocketClient.onDispatch(WebSocketClient.java:1009) ~[JDA-5.0.1.jar!/:5.0.1]
        at net.dv8tion.jda.internal.requests.WebSocketClient.onEvent(WebSocketClient.java:892) ~[JDA-5.0.1.jar!/:5.0.1]
        at net.dv8tion.jda.internal.requests.WebSocketClient.handleEvent(WebSocketClient.java:870) ~[JDA-5.0.1.jar!/:5.0.1]
        at net.dv8tion.jda.internal.requests.WebSocketClient.onBinaryMessage(WebSocketClient.java:1048) ~[JDA-5.0.1.jar!/:5.0.1]
        at com.neovisionaries.ws.client.ListenerManager.callOnBinaryMessage(ListenerManager.java:385) ~[nv-websocket-client-2.14.jar!/:na]
        at com.neovisionaries.ws.client.ReadingThread.callOnBinaryMessage(ReadingThread.java:276) ~[nv-websocket-client-2.14.jar!/:na]
        at com.neovisionaries.ws.client.ReadingThread.handleBinaryFrame(ReadingThread.java:996) ~[nv-websocket-client-2.14.jar!/:na]
        at com.neovisionaries.ws.client.ReadingThread.handleFrame(ReadingThread.java:755) ~[nv-websocket-client-2.14.jar!/:na]
        at com.neovisionaries.ws.client.ReadingThread.main(ReadingThread.java:108) ~[nv-websocket-client-2.14.jar!/:na]
        at com.neovisionaries.ws.client.ReadingThread.runMain(ReadingThread.java:64) ~[nv-websocket-client-2.14.jar!/:na]
        at com.neovisionaries.ws.client.WebSocketThread.run(WebSocketThread.java:45) ~[nv-websocket-client-2.14.jar!/:na]
carstenflokstra commented 2 months ago

I think this is being tackled by https://github.com/PiekJ/jambot/pull/103. Need to check though