Skip to content

Commit 0c03631

Browse files
committed
null-check opt
1 parent c11e67f commit 0c03631

2 files changed

Lines changed: 3 additions & 3 deletions

File tree

src/SQLProvider.DesignTime/SqlDesignTime.fs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1054,7 +1054,7 @@ module DesignTimeUtils =
10541054

10551055
try
10561056
match con with
1057-
| Some con when con <> null && con.State <> ConnectionState.Closed -> con.Close()
1057+
| Some con when not (isNull con) && con.State <> ConnectionState.Closed -> con.Close()
10581058
| _ -> ()
10591059
with
10601060
| :? ObjectDisposedException -> ()

src/SQLProvider.Runtime/Providers.SQLite.fs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ type internal SQLiteProvider(resolutionPath, contextSchemaPath, referencedAssemb
111111
#if NETSTANDARD
112112
| SQLiteLibrary.AutoSelect -> "Microsoft"
113113
#else
114-
| SQLiteLibrary.AutoSelect -> if Type.GetType ("Mono.Runtime") <> null then "Mono" else "System"
114+
| SQLiteLibrary.AutoSelect -> if not(isNull (Type.GetType "Mono.Runtime")) then "Mono" else "System"
115115
#endif
116116
| _ -> failwith ("Unsupported SQLiteLibrary option: " + sqliteLibrary.ToString())
117117
[
@@ -127,7 +127,7 @@ type internal SQLiteProvider(resolutionPath, contextSchemaPath, referencedAssemb
127127
#if NETSTANDARD
128128
| SQLiteLibrary.AutoSelect -> true
129129
#else
130-
| SQLiteLibrary.AutoSelect -> if Type.GetType ("Mono.Runtime") <> null then true else false
130+
| SQLiteLibrary.AutoSelect -> not(isNull(Type.GetType "Mono.Runtime"))
131131
#endif
132132
| _ -> failwith ("Unsupported SQLiteLibrary option: " + sqliteLibrary.ToString())
133133

0 commit comments

Comments
 (0)