Merge pull request #198 from chlupac/master

Missing nullchecks -> unhandled exceptions
This commit is contained in:
Shaun Walker 2020-02-11 14:31:48 -05:00 committed by GitHub
commit 66faa79519
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 15 additions and 9 deletions

View File

@ -304,7 +304,7 @@
SettingService.SetSetting(settings, "SMTPSSL", smtpssl);
SettingService.SetSetting(settings, "SMTPUsername", smtpusername);
SettingService.SetSetting(settings, "SMTPPassword", smtppassword);
await SettingService.UpdateModuleSettingsAsync(settings, site.SiteId);
await SettingService.UpdateSiteSettingsAsync(settings, site.SiteId);
await logger.LogInformation("Site Saved {Site}", site);

View File

@ -39,7 +39,7 @@
if (typename != null)
{
moduleType = Type.GetType(typename);
}
if (moduleType != null)
{
builder.OpenComponent(0, moduleType);
@ -50,6 +50,12 @@
// module does not exist with typename specified
message = "Module Does Not Have A Component Named " + Utilities.GetTypeNameLastSegment(typename, 0) + ".razor";
}
}
else
{
message = "Something is wrong with moduletype";
}
};
}

View File

@ -408,7 +408,7 @@
if (module.PageId == pageid)
{
// ensure module's pane exists in current page and if not, assign it to the Admin pane
if (!panes.ToLower().Contains(module.Pane.ToLower()))
if (panes == null || !panes.ToLower().Contains(module.Pane.ToLower()))
{
module.Pane = Constants.AdminPane;
}