From: jeremy-jang <35089715+jeremy-jang@users.noreply.github.com> Date: Wed, 24 Jul 2024 08:15:56 +0000 (+0900) Subject: [Tdbc] Fix static analysis issue (#6228) X-Git-Tag: submit/tizen/20240724.150945~1^2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=012c41edab37dee5b1089447001450a4af82516d;p=platform%2Fcore%2Fcsapi%2Ftizenfx.git [Tdbc] Fix static analysis issue (#6228) System.Reflection.Assembly.CreateInstance() can return null value. Signed-off-by: Sangyoon Jang --- diff --git a/src/Tizen.Data.Tdbc/Tizen.Data.Tdbc/DriverManager.cs b/src/Tizen.Data.Tdbc/Tizen.Data.Tdbc/DriverManager.cs index d7c1e113e..690f6dbb7 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; }