Fix ArgumentNullException when creating a database. (#107)

pull/112/head
Laurents Meyer 4 years ago committed by GitHub
parent 12614cd7a1
commit c09660785d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -175,18 +175,21 @@ namespace EntityFrameworkCore.Jet.Data.JetStoreSchemaDefinition
public static string ExtractFileNameFromConnectionString(string connectionString)
{
var match = _regExExtractFilenameFromConnectionString.Match(connectionString);
if (match.Success)
if (connectionString != null)
{
var fileName = match.Groups["filename"].Value;
if (match.Groups["quote"].Success)
var match = _regExExtractFilenameFromConnectionString.Match(connectionString);
if (match.Success)
{
var quoteChar = match.Groups["quote"].Value;
fileName = fileName.Replace(quoteChar + quoteChar, quoteChar);
}
var fileName = match.Groups["filename"].Value;
if (match.Groups["quote"].Success)
{
var quoteChar = match.Groups["quote"].Value;
fileName = fileName.Replace(quoteChar + quoteChar, quoteChar);
}
return fileName;
return fileName;
}
}
return connectionString;

Loading…
Cancel
Save