Skip to content

Commit d982450

Browse files
committed
Fix "Call to a member function has_child_node() on null"
1 parent 88b8679 commit d982450

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

wp-includes/sqlite-ast/class-wp-sqlite-information-schema-builder.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2073,12 +2073,12 @@ private function get_column_default( WP_Parser_Node $node ): ?string {
20732073
$literal = $signed_literal->get_first_child_node( 'literal' );
20742074

20752075
// DEFAULT NULL
2076-
if ( $literal->has_child_node( 'nullLiteral' ) ) {
2076+
if ( $literal && $literal->has_child_node( 'nullLiteral' ) ) {
20772077
return null;
20782078
}
20792079

20802080
// DEFAULT TRUE or DEFAULT FALSE
2081-
if ( $literal->has_child_node( 'boolLiteral' ) ) {
2081+
if ( $literal && $literal->has_child_node( 'boolLiteral' ) ) {
20822082
$bool_literal = $literal->get_first_child_node( 'boolLiteral' );
20832083
return $bool_literal->has_child_token( WP_MySQL_Lexer::TRUE_SYMBOL ) ? '1' : '0';
20842084
}

0 commit comments

Comments
 (0)