From 4796f2c51e362e2525f82172c6e72ed43a6f9745 Mon Sep 17 00:00:00 2001 From: MattMo Date: Wed, 28 Jun 2023 07:59:46 -0700 Subject: [PATCH] Fixed a bug with the exists function for tables. Bumped package version to 1.1.5 --- MySqlPlus/MySqlPlus.csproj | 2 +- MySqlPlus/MySqlSession.cs | 12 ++++++++---- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/MySqlPlus/MySqlPlus.csproj b/MySqlPlus/MySqlPlus.csproj index 2e43ed4..99113f0 100644 --- a/MySqlPlus/MySqlPlus.csproj +++ b/MySqlPlus/MySqlPlus.csproj @@ -7,7 +7,7 @@ MontoyaTech.MySqlPlus MontoyaTech.MySqlPlus MontoyaTech.MySqlPlus - 1.1.4 + 1.1.5 MontoyaTech A simple C# library to help work with MySql. MontoyaTech 2023 diff --git a/MySqlPlus/MySqlSession.cs b/MySqlPlus/MySqlSession.cs index 500422c..086df96 100644 --- a/MySqlPlus/MySqlSession.cs +++ b/MySqlPlus/MySqlSession.cs @@ -158,9 +158,11 @@ namespace MontoyaTech.MySqlPlus command.Exists(id); using (var reader = this.Connection.ExecuteReader(command)) - return reader.GetBoolean(0); - + if (reader.Read()) + return reader.GetBoolean(0); } + + return false; } /// @@ -176,9 +178,11 @@ namespace MontoyaTech.MySqlPlus command.Exists(id); using (var reader = this.Connection.ExecuteReader(command)) - return reader.GetBoolean(0); - + if (reader.Read()) + return reader.GetBoolean(0); } + + return false; } ///