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

Commit 27b6b6f

Browse files
committed
Check that elements exist before casting.
This was missed in the switch from casting after retrieval to casting during.
1 parent f47a7cc commit 27b6b6f

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

pkg/pgmodel/pgx.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -612,6 +612,9 @@ func (m *orderedMap) newPendingBuffer(metricTable string) *pendingBuffer {
612612

613613
func (m *orderedMap) Front() (*list.Element, *pendingBuffer) {
614614
elem := m.order.Front()
615+
if elem == nil {
616+
return nil, nil
617+
}
615618
return elem, elem.Value.(*pendingBuffer)
616619
}
617620

0 commit comments

Comments
 (0)