Browse Source

Fixed Exception when getting values from empty CoreRow objects
Fixed a "collection changed" error in Database Schema
Fixed PullToRefresh in MobileListView

Frank van den Bos 1 year ago
parent
commit
b4a4aa33e9

+ 3 - 1
InABox.Core/CoreTable/CoreRow.cs

@@ -92,7 +92,9 @@ namespace InABox.Core
             for (var i = 0; i < Table.Columns.Count; i++)
             {
                 var column = Table.Columns[i].ColumnName;
-                var value = Values[i];
+                var value =  i > -1 && i < Values.Count
+                    ? Values[i]
+                    : CoreUtils.GetDefault(Table.Columns[i].DataType);
                 try
                 {
                     if (obj.LoadedColumns.Add(column) || overrideExisting)

+ 1 - 1
InABox.Core/DatabaseSchema/DatabaseSchema.cs

@@ -59,7 +59,7 @@ namespace InABox.Core
 
         public static void InitializeSubObjects(BaseObject obj)
         {
-            var objs = GetSubObjectDefs(obj.GetType());
+            var objs = GetSubObjectDefs(obj.GetType())?.ToArray();
             if(objs is null)
             {
                 return;

+ 1 - 1
InABox.Mobile/InABox.Mobile.Shared/Components/MobileListView/MobileListView.xaml

@@ -22,7 +22,7 @@
                     SelectionMode="None"
                     SeparatorVisibility="Default"
                     SeparatorColor="Transparent" 
-                    IsPullToRefreshEnabled="True">
+                    IsPullToRefreshEnabled="{Binding PullToRefresh}">
                 </ListView>
             
             <local:MobileCard