Skip to content

Commit a23e1be

Browse files
Copilotswissspidy
andcommitted
Fix hook filtering to skip loggers without hook property
Co-authored-by: swissspidy <841956+swissspidy@users.noreply.github.com>
1 parent b4b128a commit a23e1be

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

src/Command.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -606,6 +606,11 @@ public function queries( $args, $assoc_args ) {
606606
if ( $hook && isset( $logger->hook ) && $logger->hook !== $hook ) {
607607
continue;
608608
}
609+
610+
// Skip if filtering for a specific hook and the logger has no hook property
611+
if ( $hook && ! isset( $logger->hook ) ) {
612+
continue;
613+
}
609614

610615
// Get the query indices for this logger
611616
if ( isset( $logger->query_indices ) && ! empty( $logger->query_indices ) ) {

0 commit comments

Comments
 (0)