Skip to content
This repository has been archived by the owner on Apr 2, 2024. It is now read-only.

Commit

Permalink
Check that elements exist before casting.
Browse files Browse the repository at this point in the history
This was missed in the switch from casting after retrieval to casting
during.
  • Loading branch information
JLockerman committed Apr 14, 2020
1 parent f47a7cc commit 27b6b6f
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions pkg/pgmodel/pgx.go
Original file line number Diff line number Diff line change
Expand Up @@ -612,6 +612,9 @@ func (m *orderedMap) newPendingBuffer(metricTable string) *pendingBuffer {

func (m *orderedMap) Front() (*list.Element, *pendingBuffer) {
elem := m.order.Front()
if elem == nil {
return nil, nil
}
return elem, elem.Value.(*pendingBuffer)
}

Expand Down

0 comments on commit 27b6b6f

Please sign in to comment.