Simplix-Softworks / Cirrus

Minecraft GUI library for Spigot, BungeeCord and Velocity. Powered by Protocolize v2!
MIT License
132 stars 4 forks source link

MultiPage Menu Example causes NullPointerException #13

Closed galexrt closed 2 years ago

galexrt commented 2 years ago

I have just tried to use the example code together with the MultiPageMenu example from the wiki causes an NPE.

Adding a simple display name and lore to the addItems() loop (that adds all the items) fixes the issue and causes the menu to work without an NPE.

I have used Cirrus 2.0-SNAPSHOT that was pulled yesterday / today. Please let me know if you need more information.

[02:35:57 WARN]: Error in dispatching command
java.lang.NullPointerException: Cannot read the array length because "<local1>" is null
    at dev.simplix.cirrus.common.Utils.removeItalic(Utils.java:9) ~[?:?]
    at dev.simplix.cirrus.bungeecord.protocolize.ProtocolizeMenuBuilder.open(ProtocolizeMenuBuilder.java:260) ~[?:?]
    at dev.simplix.cirrus.bungeecord.protocolize.ProtocolizeMenuBuilder.build(ProtocolizeMenuBuilder.java:78) ~[?:?]
    at dev.simplix.cirrus.common.menus.MultiPageMenu$PageMenu.build(MultiPageMenu.java:236) ~[?:?]
    at dev.simplix.cirrus.common.menu.AbstractMenu.open(AbstractMenu.java:123) ~[?:?]
    at dev.simplix.cirrus.common.menus.MultiPageMenu.open(MultiPageMenu.java:93) ~[?:?]
    at net.platzhaltergaming.serverselector.bungee.commands.ServersCommand.execute(ServersCommand.java:40) ~[?:?]
    at net.md_5.bungee.api.plugin.PluginManager.dispatchCommand(PluginManager.java:212) ~[waterfall.jar:git:Waterfall-Bootstrap:1.18-R0.1-SNAPSHOT:21e4c1d:475]
    at net.md_5.bungee.api.plugin.PluginManager.dispatchCommand(PluginManager.java:163) ~[waterfall.jar:git:Waterfall-Bootstrap:1.18-R0.1-SNAPSHOT:21e4c1d:475]
    at net.md_5.bungee.connection.UpstreamBridge.handle(UpstreamBridge.java:168) ~[waterfall.jar:git:Waterfall-Bootstrap:1.18-R0.1-SNAPSHOT:21e4c1d:475]
    at net.md_5.bungee.protocol.packet.Chat.handle(Chat.java:76) ~[waterfall.jar:git:Waterfall-Bootstrap:1.18-R0.1-SNAPSHOT:21e4c1d:475]
    at net.md_5.bungee.netty.HandlerBoss.channelRead(HandlerBoss.java:114) ~[waterfall.jar:git:Waterfall-Bootstrap:1.18-R0.1-SNAPSHOT:21e4c1d:475]
    at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:379) ~[waterfall.jar:git:Waterfall-Bootstrap:1.18-R0.1-SNAPSHOT:21e4c1d:475]
    at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:365) ~[waterfall.jar:git:Waterfall-Bootstrap:1.18-R0.1-SNAPSHOT:21e4c1d:475]
    at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:357) ~[waterfall.jar:git:Waterfall-Bootstrap:1.18-R0.1-SNAPSHOT:21e4c1d:475]
    at io.netty.handler.codec.MessageToMessageDecoder.channelRead(MessageToMessageDecoder.java:103) ~[waterfall.jar:git:Waterfall-Bootstrap:1.18-R0.1-SNAPSHOT:21e4c1d:475]
    at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:379) ~[waterfall.jar:git:Waterfall-Bootstrap:1.18-R0.1-SNAPSHOT:21e4c1d:475]
    at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:365) ~[waterfall.jar:git:Waterfall-Bootstrap:1.18-R0.1-SNAPSHOT:21e4c1d:475]
    at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:357) ~[waterfall.jar:git:Waterfall-Bootstrap:1.18-R0.1-SNAPSHOT:21e4c1d:475]
    at io.netty.handler.timeout.IdleStateHandler.channelRead(IdleStateHandler.java:286) ~[waterfall.jar:git:Waterfall-Bootstrap:1.18-R0.1-SNAPSHOT:21e4c1d:475]
    at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:379) ~[waterfall.jar:git:Waterfall-Bootstrap:1.18-R0.1-SNAPSHOT:21e4c1d:475]
    at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:365) ~[waterfall.jar:git:Waterfall-Bootstrap:1.18-R0.1-SNAPSHOT:21e4c1d:475]
    at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:357) ~[waterfall.jar:git:Waterfall-Bootstrap:1.18-R0.1-SNAPSHOT:21e4c1d:475]
    at io.netty.handler.codec.MessageToMessageDecoder.channelRead(MessageToMessageDecoder.java:103) ~[waterfall.jar:git:Waterfall-Bootstrap:1.18-R0.1-SNAPSHOT:21e4c1d:475]
    at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:379) ~[waterfall.jar:git:Waterfall-Bootstrap:1.18-R0.1-SNAPSHOT:21e4c1d:475]
    at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:365) ~[waterfall.jar:git:Waterfall-Bootstrap:1.18-R0.1-SNAPSHOT:21e4c1d:475]
    at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:357) ~[waterfall.jar:git:Waterfall-Bootstrap:1.18-R0.1-SNAPSHOT:21e4c1d:475]
    at io.netty.handler.codec.MessageToMessageDecoder.channelRead(MessageToMessageDecoder.java:103) ~[waterfall.jar:git:Waterfall-Bootstrap:1.18-R0.1-SNAPSHOT:21e4c1d:475]
    at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:379) ~[waterfall.jar:git:Waterfall-Bootstrap:1.18-R0.1-SNAPSHOT:21e4c1d:475]
    at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:365) ~[waterfall.jar:git:Waterfall-Bootstrap:1.18-R0.1-SNAPSHOT:21e4c1d:475]
    at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:357) ~[waterfall.jar:git:Waterfall-Bootstrap:1.18-R0.1-SNAPSHOT:21e4c1d:475]
    at io.netty.handler.codec.MessageToMessageDecoder.channelRead(MessageToMessageDecoder.java:103) ~[waterfall.jar:git:Waterfall-Bootstrap:1.18-R0.1-SNAPSHOT:21e4c1d:475]
    at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:379) ~[waterfall.jar:git:Waterfall-Bootstrap:1.18-R0.1-SNAPSHOT:21e4c1d:475]
    at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:365) ~[waterfall.jar:git:Waterfall-Bootstrap:1.18-R0.1-SNAPSHOT:21e4c1d:475]
    at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:357) ~[waterfall.jar:git:Waterfall-Bootstrap:1.18-R0.1-SNAPSHOT:21e4c1d:475]
    at io.netty.handler.codec.ByteToMessageDecoder.fireChannelRead(ByteToMessageDecoder.java:324) ~[waterfall.jar:git:Waterfall-Bootstrap:1.18-R0.1-SNAPSHOT:21e4c1d:475]
    at io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:296) ~[waterfall.jar:git:Waterfall-Bootstrap:1.18-R0.1-SNAPSHOT:21e4c1d:475]
    at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:379) ~[waterfall.jar:git:Waterfall-Bootstrap:1.18-R0.1-SNAPSHOT:21e4c1d:475]
    at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:365) ~[waterfall.jar:git:Waterfall-Bootstrap:1.18-R0.1-SNAPSHOT:21e4c1d:475]
    at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:357) ~[waterfall.jar:git:Waterfall-Bootstrap:1.18-R0.1-SNAPSHOT:21e4c1d:475]
    at io.netty.handler.codec.MessageToMessageDecoder.channelRead(MessageToMessageDecoder.java:103) ~[waterfall.jar:git:Waterfall-Bootstrap:1.18-R0.1-SNAPSHOT:21e4c1d:475]
    at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:379) ~[waterfall.jar:git:Waterfall-Bootstrap:1.18-R0.1-SNAPSHOT:21e4c1d:475]
    at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:365) ~[waterfall.jar:git:Waterfall-Bootstrap:1.18-R0.1-SNAPSHOT:21e4c1d:475]
    at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:357) ~[waterfall.jar:git:Waterfall-Bootstrap:1.18-R0.1-SNAPSHOT:21e4c1d:475]
    at io.netty.channel.DefaultChannelPipeline$HeadContext.channelRead(DefaultChannelPipeline.java:1410) ~[waterfall.jar:git:Waterfall-Bootstrap:1.18-R0.1-SNAPSHOT:21e4c1d:475]
    at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:379) ~[waterfall.jar:git:Waterfall-Bootstrap:1.18-R0.1-SNAPSHOT:21e4c1d:475]
    at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:365) ~[waterfall.jar:git:Waterfall-Bootstrap:1.18-R0.1-SNAPSHOT:21e4c1d:475]
    at io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:919) ~[waterfall.jar:git:Waterfall-Bootstrap:1.18-R0.1-SNAPSHOT:21e4c1d:475]
    at io.netty.channel.epoll.AbstractEpollStreamChannel$EpollStreamUnsafe.epollInReady(AbstractEpollStreamChannel.java:795) ~[waterfall.jar:git:Waterfall-Bootstrap:1.18-R0.1-SNAPSHOT:21e4c1d:475]
    at io.netty.channel.epoll.EpollEventLoop.processReady(EpollEventLoop.java:480) ~[waterfall.jar:git:Waterfall-Bootstrap:1.18-R0.1-SNAPSHOT:21e4c1d:475]
    at io.netty.channel.epoll.EpollEventLoop.run(EpollEventLoop.java:378) ~[waterfall.jar:git:Waterfall-Bootstrap:1.18-R0.1-SNAPSHOT:21e4c1d:475]
    at io.netty.util.concurrent.SingleThreadEventExecutor$4.run(SingleThreadEventExecutor.java:986) ~[waterfall.jar:git:Waterfall-Bootstrap:1.18-R0.1-SNAPSHOT:21e4c1d:475]
    at io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74) ~[waterfall.jar:git:Waterfall-Bootstrap:1.18-R0.1-SNAPSHOT:21e4c1d:475]
    at java.lang.Thread.run(Thread.java:833) [?:?]
KotlinFactory commented 2 years ago

Hey,

Thanks for using Cirrus & reporting this issue here. Cirrus 2.0-SNAPSHOT is outdated on likely won't work anymore. Please upgrade to 2.0.0. MultiPageMenus are currently used in production so they should work fine. If it's still happening please just respond here and we will reopen this.

Regards, Leonhard