Skip to content

Commit 8fad43c

Browse files
authored
Merge pull request #6486 from bdukes/set-module-setting
Do not throw if existing value is null
2 parents c0a602c + 867b7f3 commit 8fad43c

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

DNN Platform/Library/Entities/Modules/ModuleController.cs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2406,9 +2406,10 @@ private void UpdateModuleSettingInternal(int moduleId, string settingName, strin
24062406
dr = DataProvider.GetModuleSetting(moduleId, settingName);
24072407

24082408
string existValue = null;
2409-
if (dr.Read())
2409+
const int SettingValueColumnIndex = 1;
2410+
if (dr.Read() && !dr.IsDBNull(SettingValueColumnIndex))
24102411
{
2411-
existValue = dr.GetString(1);
2412+
existValue = dr.GetString(SettingValueColumnIndex);
24122413
}
24132414

24142415
dr.Close();

0 commit comments

Comments
 (0)