From 88ec8713d0149f512f7a8d74c40816ec2628fa95 Mon Sep 17 00:00:00 2001 From: Cory Rivera Date: Tue, 11 Jul 2023 17:11:58 -0700 Subject: [PATCH] Only set Restrict Access if a non-null value is provided (#2140) --- .../ObjectTypes/Database/DatabaseHandler.cs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/Microsoft.SqlTools.ServiceLayer/ObjectManagement/ObjectTypes/Database/DatabaseHandler.cs b/src/Microsoft.SqlTools.ServiceLayer/ObjectManagement/ObjectTypes/Database/DatabaseHandler.cs index 70aec2c3..6a8a31cf 100644 --- a/src/Microsoft.SqlTools.ServiceLayer/ObjectManagement/ObjectTypes/Database/DatabaseHandler.cs +++ b/src/Microsoft.SqlTools.ServiceLayer/ObjectManagement/ObjectTypes/Database/DatabaseHandler.cs @@ -479,9 +479,12 @@ namespace Microsoft.SqlTools.ServiceLayer.ObjectManagement // AutoCreateStatisticsIncremental can only be set when AutoCreateStatistics is enabled prototype.AutoCreateStatisticsIncremental = database.AutoCreateIncrementalStatistics; prototype.AutoCreateStatistics = database.AutoCreateStatistics; - prototype.AutoShrink= database.AutoShrink; + prototype.AutoShrink = database.AutoShrink; prototype.AutoUpdateStatistics = database.AutoUpdateStatistics; - prototype.RestrictAccess = database.RestrictAccess; + if (database.RestrictAccess != null) + { + prototype.RestrictAccess = database.RestrictAccess; + } if (prototype is DatabasePrototypeAzure dbAz) {