From bf1c27d5d4b84919370bf6edfd648006c517e27a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20M=C3=AD=C5=A1ek?= Date: Tue, 25 Feb 2025 13:12:22 +0100 Subject: [PATCH] mysqli field_count nullref check ref: https://github.com/peachpiecompiler/peachpie/issues/1162 --- src/Peachpie.Library.MySql/MySqli/mysqli.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Peachpie.Library.MySql/MySqli/mysqli.cs b/src/Peachpie.Library.MySql/MySqli/mysqli.cs index 4adad1640b..5dd2ef27b6 100644 --- a/src/Peachpie.Library.MySql/MySqli/mysqli.cs +++ b/src/Peachpie.Library.MySql/MySqli/mysqli.cs @@ -88,7 +88,7 @@ internal mysqli(Context ctx, IDbConnection dbconnection) /// /// Returns the number of columns for the most recent query. /// - public int field_count => Connection.LastResult.FieldCount; + public int field_count => Connection.LastResult?.FieldCount ?? 0; /// /// Get MySQL client info.