gitbitex / gitbitex-new

an open source cryptocurrency exchange
Apache License 2.0
230 stars 84 forks source link

Exception in thread "redisson-3-16" java.lang.NullPointerException #7

Closed SimonVillage closed 2 years ago

SimonVillage commented 2 years ago

I receive the following error on match:

2022-04-24 07:16:06.308  INFO 1 --- [       Accountant-58] com.gitbitex.account.AccountManager      : hold 989962d0-543a-4d4e-bf76-105c6334637f BTC 0.00100000
Exception in thread "redisson-3-16" java.lang.NullPointerException
at com.gitbitex.feed.FeedMessageListener.orderDoneMessage(FeedMessageListener.java:136)
at com.gitbitex.feed.FeedMessageListener.lambda$run$5(FeedMessageListener.java:81)
at org.redisson.PubSubMessageListener.onMessage(PubSubMessageListener.java:79)
at org.redisson.client.RedisPubSubConnection.onMessage(RedisPubSubConnection.java:78)
at org.redisson.client.handler.CommandPubSubDecoder.lambda$enqueueMessage$0(CommandPubSubDecoder.java:179)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1130)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:630)
at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30)
at java.base/java.lang.Thread.run(Thread.java:832)
greensheng commented 2 years ago

The order of MARKET type has no price and remainingSize, so a NPE will be thrown.

Checking null should solve the problem: https://github.com/gitbitex/gitbitex-new/commit/9873383e241291cbdcba468e22fc8d8b67f4d987