From 142faa746e6fd988578e30814ea1d4b91bd26e74 Mon Sep 17 00:00:00 2001 From: Deividas Petraitis Date: Tue, 3 Sep 2024 18:38:05 +0300 Subject: [PATCH] Fix: Orderbook ProcessPool panic (#497) --- orderbook/usecase/orderbook_usecase.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/orderbook/usecase/orderbook_usecase.go b/orderbook/usecase/orderbook_usecase.go index 3763e9a1b..2635ae27d 100644 --- a/orderbook/usecase/orderbook_usecase.go +++ b/orderbook/usecase/orderbook_usecase.go @@ -72,6 +72,10 @@ func (o *orderbookUseCaseImpl) ProcessPool(ctx context.Context, pool sqsdomain.P return fmt.Errorf("pool is not an orderbook pool %d", poolID) } + if cosmWasmPoolModel.Data.Orderbook == nil { + return fmt.Errorf("pool has no orderbook data %d", poolID) + } + // Update the orderbook client with the orderbook pool ID. ticks := cosmWasmPoolModel.Data.Orderbook.Ticks if len(ticks) == 0 {