瀏覽代碼

Fixed error when clicking header in equipmentGrid

Kenric Nugteren 7 月之前
父節點
當前提交
3fc9e8f66f
共有 1 個文件被更改,包括 7 次插入5 次删除
  1. 7 5
      prs.desktop/Panels/Equipment/EquipmentGrid.cs

+ 7 - 5
prs.desktop/Panels/Equipment/EquipmentGrid.cs

@@ -61,7 +61,7 @@ namespace PRSDesktop
             options.FilterRows = true;
         }
 
-        private bool DocumentsClick(CoreRow arg)
+        private bool DocumentsClick(CoreRow? arg)
         {
             if (arg == null)
                 return false;
@@ -92,7 +92,7 @@ namespace PRSDesktop
             return false;
         }
 
-        private BitmapImage DocumentsImage(CoreRow arg)
+        private BitmapImage? DocumentsImage(CoreRow? arg)
         {
             if (arg == null)
                 return docs;
@@ -169,8 +169,10 @@ namespace PRSDesktop
             base.Reload(criteria, columns, ref sort, token, action);
         }
 
-        private bool ShowSpecificationSheet(CoreRow arg)
+        private bool ShowSpecificationSheet(CoreRow? arg)
         {
+            if (arg is null) return false;
+
             var id = Entity.EntityLinkID<Equipment, ImageDocumentLink>(x => x.SpecificationSheet, arg);
             //String file = arg.Get<Equipment, String>(x => x.Specification.FileName);
             if (id != null)
@@ -199,7 +201,7 @@ namespace PRSDesktop
         }
 
 
-        private BitmapImage? SpecificationImage(CoreRow arg)
+        private BitmapImage? SpecificationImage(CoreRow? arg)
         {
             if (arg == null)
                 return specification;
@@ -208,7 +210,7 @@ namespace PRSDesktop
             return id == null ? null : specification;
         }
 
-        public override bool EditItems(Equipment[] items, Func<Type, CoreTable>? PageDataHandler = null, bool PreloadPages = false)
+        public override bool EditItems(Equipment[] items, Func<Type, CoreTable?>? PageDataHandler = null, bool PreloadPages = false)
         {
             var result = base.EditItems(items, PageDataHandler, PreloadPages);
             if (result)