瀏覽代碼

修复500bug

lcl 1 年之前
父節點
當前提交
1430f7b808
共有 1 個文件被更改,包括 5 次插入1 次删除
  1. 5 1
      Areas/Web/Controllers/PageController.cs

+ 5 - 1
Areas/Web/Controllers/PageController.cs

@@ -50,7 +50,11 @@ namespace MySystem.Areas.Web.Controllers
 
             AppResultJson result = (AppResultJson)new Api.Controllers.PageUpdateInfoController(_accessor, _logger, _setting).CheckDo("{\"Url\":\"" + Url.Replace("_", "#") + "\",\"Kind\":\"" + Kind + "\",\"apptype\":\"web\",\"version\":\"1.00\"}").Value;
             Dictionary<string, string> Obj = result.Data as Dictionary<string, string>;
-            string ModuleContent = Obj["ModuleContent"];
+            string ModuleContent = "";
+            if(Obj.ContainsKey("ModuleContent"))
+            {
+                ModuleContent = Obj["ModuleContent"];
+            }
             if (Url == "user-maker-policy" && !string.IsNullOrEmpty(Id))
             {
                 ModuleContent = ModuleContent.Replace("getCookieInfo('pageId')", Id);