Parcourir la source

Array out of bounds checking for delimitedfilereader

Kenric Nugteren il y a 1 an
Parent
commit
37ef2f212e

+ 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();