diff --git a/collector/offchain_input_iterator.go b/collector/offchain_input_iterator.go index 2d68c4c1..fe3bc631 100644 --- a/collector/offchain_input_iterator.go +++ b/collector/offchain_input_iterator.go @@ -119,9 +119,10 @@ func (r *OffChainInputIterator) isTransactionInputForSearchKey(transactionInputW if filter.Script != nil { switch searchKey.ScriptType { case "lock": - if !cellOutput.Type.Equals(filter.Script) { + if cellOutput.Type == nil || !cellOutput.Type.Equals(filter.Script) { return false } + break case "type": if !cellOutput.Lock.Equals(filter.Script) { diff --git a/indexer/indexer_test.go b/indexer/indexer_test.go index 50b24129..359672b1 100644 --- a/indexer/indexer_test.go +++ b/indexer/indexer_test.go @@ -78,7 +78,7 @@ func TestGetCellsMaxLimit(t *testing.T) { } resp, err := c.GetCells(context.Background(), s, SearchOrderAsc, math.MaxUint32, "") checkError(t, err) - assert.Equal(t, 34, len(resp.Objects)) + assert.Equal(t, 37, len(resp.Objects)) // Check response when `WithData` == true in request s = &SearchKey{