Skip to content

Commit

Permalink
A record is an Object, not an Array, so we should use property_exists…
Browse files Browse the repository at this point in the history
…() instead array_key_exists.
  • Loading branch information
Soean committed Jan 12, 2024
1 parent 0336294 commit c3a0b9c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion classes/class-cli.php
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ public function query( $args, $assoc_args ) {

// Catch any fields missing in records.
foreach ( $fields as $field ) {
if ( ! array_key_exists( $field, $record ) ) {
if ( ! property_exists( $record, $field ) ) {
$record->$field = null;
}
}
Expand Down

0 comments on commit c3a0b9c

Please sign in to comment.