Skip to content

Commit

Permalink
Add check if the FailOverPartner key exists first before retrieving i…
Browse files Browse the repository at this point in the history
…ts value from the SqlConnectionString (#1614)
  • Loading branch information
lcheunglci authored Jul 26, 2022
1 parent 13b8c7d commit 6bfdb63
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,8 @@ private PermissionSet CreateFailoverPermission(SqlConnectionString userConnectio
// the server, we will use that name over what was specified
// in the original connection string.

if (null == userConnectionOptions[SqlConnectionString.KEY.FailoverPartner])
if (userConnectionOptions.ContainsKey(SqlConnectionString.KEY.FailoverPartner) &&
null == userConnectionOptions[SqlConnectionString.KEY.FailoverPartner])
{
keywordToReplace = SqlConnectionString.KEY.Data_Source;
}
Expand Down

0 comments on commit 6bfdb63

Please sign in to comment.