Browse Source

Fixed exception in ManufacturingHistoryStore

frogsoftware 5 days ago
parent
commit
e9ea12486b

+ 1 - 1
prs.desktop/prsdesktop.iss

@@ -8,7 +8,7 @@
 #define public Dependency_Path_NetCoreCheck "dependencies\"
 
 #define MyAppName "PRS Desktop"
-#define MyAppVersion "8.58.8"
+#define MyAppVersion "8.58.9"
 #define MyAppPublisher "PRS Digital"
 #define MyAppURL "https://www.prs-software.com.au"
 #define MyAppExeName "PRSDesktop.exe"

+ 1 - 1
prs.licensing/PRSLicensing.iss

@@ -8,7 +8,7 @@
 #define public Dependency_Path_NetCoreCheck "dependencies\"
 
 #define MyAppName "PRS Licensing"
-#define MyAppVersion "8.58.8"
+#define MyAppVersion "8.58.9"
 #define MyAppPublisher "PRS Digital"
 #define MyAppURL "https://www.prs-software.com.au"
 #define MyAppExeName "PRSLicensing.exe"

+ 1 - 1
prs.server/PRSServer.iss

@@ -8,7 +8,7 @@
 #define public Dependency_Path_NetCoreCheck "dependencies\"
 
 #define MyAppName "PRS Server"
-#define MyAppVersion "8.58.8"
+#define MyAppVersion "8.58.9"
 #define MyAppPublisher "PRS Digital"
 #define MyAppURL "https://www.prs-software.com.au"
 #define MyAppExeName "PRSServer.exe"

+ 5 - 3
prs.stores/ManufacturingHistoryStore.cs

@@ -22,9 +22,9 @@ namespace Comal.Stores
             var start = TimeSpan.FromMinutes(Math.Floor(entity.Created.TimeOfDay.Subtract(entity.Window).TotalMinutes / 15.0F) * 15.0F);
             var finish = start.Add(new TimeSpan(0, 15, 0));
 
-            var sDescription = entity.LostTime.IsValid() ? entity.Description : "Manufacturing Time";
+            var sDescription = entity.LostTime.IsValid() ? entity.Description : "Manufacturing Time" ?? "Manufacturing Time";
 
-            var ass = Provider.Query(
+            var assrows = Provider.Query(
                 Filter<Assignment>.Where(x => x.Employee.ID).IsEqualTo(entity.Employee.ID)
                     .And(x => x.Date).IsEqualTo(entity.Date)
                     .And(x => x.Actual.Finish).IsGreaterThanOrEqualTo(start)
@@ -37,7 +37,9 @@ namespace Comal.Stores
                     x => x.Actual.Finish
                 ),
                 new SortOrder<Assignment>(x => x.Actual.Finish, SortDirection.Descending)
-            ).Rows.Where(r => r.Get<Assignment, string>(c => c.Description).StartsWith(sDescription)).FirstOrDefault()?.ToObject<Assignment>();
+            ).Rows;
+            var assrow = assrows.FirstOrDefault(r => (r.Get<Assignment, string>(c => c.Description) ?? "").StartsWith(sDescription));
+            var ass = assrow?.ToObject<Assignment>();
 
             if (ass == null)
             {