[Java API] Ticket Status Throws NPE


#1

My Code:

(Line 141 being "\n§fStatus: §7" + WordUtils.capitalize(ticket.getStatus().name().toLowerCase().replaceAll("_", " ")) +)

The only thing causing an issue here is the ticket’s status, and I know that enums have caused issues before.

Stack Trace:

03.09 17:59:19 [Server] INFO CubedPay - Error: Invoke exception on PrismListener#onSupportTicketNewReply()
03.09 17:59:19 [Server] WARN java.lang.NullPointerException
03.09 17:59:19 [Server] WARN at com.berttowne.cubedpay.PrismListener.onSupportTicketNewReply(PrismListener.java:141)
03.09 17:59:19 [Server] WARN at sun.reflect.GeneratedMethodAccessor35.invoke(Unknown Source)
03.09 17:59:19 [Server] WARN at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
03.09 17:59:19 [Server] WARN at java.lang.reflect.Method.invoke(Unknown Source)
03.09 17:59:19 [Server] WARN at co.melondev.cubedpay.events.CubedAnnotationProcessor.lambda$emitEvent$20(CubedAnnotationProcessor.java:39)
03.09 17:59:19 [Server] WARN at java.lang.Iterable.forEach(Unknown Source)
03.09 17:59:19 [Server] WARN at co.melondev.cubedpay.events.CubedAnnotationProcessor.emitEvent(CubedAnnotationProcessor.java:36)
03.09 17:59:19 [Server] WARN at co.melondev.cubedpay.CubedPayAPI.emitEvent(CubedPayAPI.java:140)
03.09 17:59:19 [Server] WARN at co.melondev.cubedpay.events.CubedEventRunnable.lambda$null$24(CubedEventRunnable.java:30)
03.09 17:59:19 [Server] WARN at java.util.ArrayList.forEach(Unknown Source)
03.09 17:59:19 [Server] WARN at co.melondev.cubedpay.events.CubedEventRunnable.lambda$run$25(CubedEventRunnable.java:27)
03.09 17:59:19 [Server] WARN at java.util.concurrent.CompletableFuture.uniAccept(Unknown Source)
03.09 17:59:19 [Server] WARN at java.util.concurrent.CompletableFuture$UniAccept.tryFire(Unknown Source)
03.09 17:59:19 [Server] WARN at java.util.concurrent.CompletableFuture.postComplete(Unknown Source)
03.09 17:59:19 [Server] WARN at java.util.concurrent.CompletableFuture.complete(Unknown Source)
03.09 17:59:19 [Server] WARN at retrofit2.adapter.java8.Java8CallAdapterFactory$BodyCallAdapter$2.onResponse(Java8CallAdapterFactory.java:107)
03.09 17:59:19 [Server] WARN at retrofit2.OkHttpCall$1.onResponse(OkHttpCall.java:123)
03.09 17:59:19 [Server] WARN at okhttp3.RealCall$AsyncCall.execute(RealCall.java:153)
03.09 17:59:19 [Server] WARN at okhttp3.internal.NamedRunnable.run(NamedRunnable.java:32)
03.09 17:59:19 [Server] WARN at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
03.09 17:59:19 [Server] WARN at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
03.09 17:59:19 [Server] WARN at java.lang.Thread.run(Unknown Source)