Skip to content

Commit 14dc77a

Browse files
committed
Guard against null child node in read-only detection
1 parent 752a8c4 commit 14dc77a

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

packages/mysql-on-sqlite/src/sqlite/class-wp-pdo-mysql-on-sqlite.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -896,8 +896,8 @@ public function query( string $query, ?int $fetch_mode = null, ...$fetch_mode_ar
896896
* [GRAMMAR]
897897
* simpleStatement: selectStatement | showStatement | utilityStatement | ...
898898
*/
899-
$statement_node = $child_node->get_first_child_node();
900-
if ( null !== $statement_node ) {
899+
if ( null !== $child_node && $child_node->has_child_node() ) {
900+
$statement_node = $child_node->get_first_child_node();
901901
if (
902902
'selectStatement' === $statement_node->rule_name
903903
|| 'showStatement' === $statement_node->rule_name

0 commit comments

Comments
 (0)