From 012c41edab37dee5b1089447001450a4af82516d Mon Sep 17 00:00:00 2001 From: jeremy-jang <35089715+jeremy-jang@users.noreply.github.com> Date: Wed, 24 Jul 2024 17:15:56 +0900 Subject: [PATCH] [Tdbc] Fix static analysis issue (#6228) System.Reflection.Assembly.CreateInstance() can return null value. Signed-off-by: Sangyoon Jang --- src/Tizen.Data.Tdbc/Tizen.Data.Tdbc/DriverManager.cs | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/Tizen.Data.Tdbc/Tizen.Data.Tdbc/DriverManager.cs b/src/Tizen.Data.Tdbc/Tizen.Data.Tdbc/DriverManager.cs index d7c1e11..690f6db 100644 --- a/src/Tizen.Data.Tdbc/Tizen.Data.Tdbc/DriverManager.cs +++ b/src/Tizen.Data.Tdbc/Tizen.Data.Tdbc/DriverManager.cs @@ -58,6 +58,11 @@ namespace Tizen.Data.Tdbc throw new SystemException("Failed to open connection due to: " + ex); } + if (conn == null) + { + throw new SystemException("Failed to open connection"); + } + conn.Open(uri); return conn; } @@ -90,6 +95,11 @@ namespace Tizen.Data.Tdbc throw new SystemException("Failed to open connection due to: " + ex); } + if (conn == null) + { + throw new SystemException("Failed to open connection"); + } + conn.Open(connectionString); return conn; } -- 2.7.4