浏览代码

Array out of bounds checking for delimitedfilereader

Kenric Nugteren 1 年之前
父节点
当前提交
37ef2f212e
共有 2 个文件被更改,包括 2 次插入2 次删除
  1. 1 1
      inabox.scripting/FileReader/DelimitedFileReader.cs
  2. 1 1
      inabox.wpf/DynamicGrid/BaseDynamicGrid.cs

+ 1 - 1
inabox.scripting/FileReader/DelimitedFileReader.cs

@@ -53,7 +53,7 @@ namespace InABox.Scripting
                 x => x.Key,
                 x =>
                 {
-                    object? result = values[x.Value];
+                    object? result = x.Value < values.Length ? values[x.Value] : null;
                     return result;
                 });
         }

+ 1 - 1
inabox.wpf/DynamicGrid/BaseDynamicGrid.cs

@@ -174,7 +174,7 @@ namespace InABox.DynamicGrid
         public abstract void Refresh(bool reloadcolumns, bool reloaddata);
 
         public abstract void UpdateRow<TType>(CoreRow row, string column, TType value, bool refresh = true);
-        public abstract void UpdateRow<T, TType>(CoreRow row, Expression<Func<T, TType>> column, TType value, bool refresh = true);
+        public abstract void UpdateRow<TRow, TType>(CoreRow row, Expression<Func<TRow, TType>> column, TType value, bool refresh = true);
         
         protected abstract DynamicGridRowStyleSelector<T> GetRowStyleSelector();