Skip to content

Commit

Permalink
Merge pull request #218 from shaojunda/shaojunda-fix-nil-type
Browse files Browse the repository at this point in the history
fix: nil type script
  • Loading branch information
quake authored Feb 23, 2024
2 parents 4f43fd5 + 6521204 commit f37319b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion collector/offchain_input_iterator.go
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
2 changes: 1 addition & 1 deletion indexer/indexer_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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{
Expand Down

0 comments on commit f37319b

Please sign in to comment.