Skip to content

Commit cc82553

Browse files
committed
Addressing code review comments.
1 parent b5fdea1 commit cc82553

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/ResourceManager/Sql/Commands.Sql/Database/Cmdlet/SetAzureSqlDatabase.cs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -122,9 +122,11 @@ protected override IEnumerable<AzureSqlDatabaseModel> PersistChanges(IEnumerable
122122
{
123123
response = ModelAdapter.UpsertDatabase(this.ResourceGroupName, this.ServerName, entity.First());
124124
}
125-
catch(ArgumentNullException ex)
125+
catch (ArgumentNullException ex)
126126
{
127-
if(ex.ParamName == "operationStatusLink")
127+
// This is needed because on v11 servers the call to update database will return synchronously if the operation finishes quickly
128+
// whereas for v12 servers it is always async. If the call retuns synchronously the operationStatusLink will be null.
129+
if (ex.ParamName == "operationStatusLink")
128130
{
129131
response = ModelAdapter.GetDatabase(this.ResourceGroupName, this.ServerName, entity.First().DatabaseName);
130132
}

0 commit comments

Comments
 (0)