Skip to content

Commit bf1c27d

Browse files
committed
mysqli field_count nullref check
ref: #1162
1 parent f07ce7f commit bf1c27d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/Peachpie.Library.MySql/MySqli/mysqli.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ internal mysqli(Context ctx, IDbConnection dbconnection)
8888
/// <summary>
8989
/// Returns the number of columns for the most recent query.
9090
/// </summary>
91-
public int field_count => Connection.LastResult.FieldCount;
91+
public int field_count => Connection.LastResult?.FieldCount ?? 0;
9292

9393
/// <summary>
9494
/// Get MySQL client info.

0 commit comments

Comments
 (0)