Skip to content

Commit b45e249

Browse files
committed
Merge pull request #29 from foriequal0/fix/connection-string-end-with-semicolon
Fix IndexOutOfRangeException when connection string format end with ';'
2 parents a75917e + ce2d6fe commit b45e249

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

SQLite.CodeFirst/SqliteConnectionStringParser.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,9 @@ public static IDictionary<string, string> ParseSqliteConnectionString(string con
2020
foreach (var keyValuePair in keyValuePairs)
2121
{
2222
string[] keyValue = keyValuePair.Split(KeyValueSeperator);
23-
keyValuePairDictionary.Add(keyValue[KeyPosition].ToLower(), keyValue[ValuePosition]);
23+
if (keyValue.Length >= 2){
24+
keyValuePairDictionary.Add(keyValue[KeyPosition].ToLower(), keyValue[ValuePosition]);
25+
}
2426
}
2527

2628
return keyValuePairDictionary;

0 commit comments

Comments
 (0)