Skip to content

Commit b78f1c9

Browse files
committed
Exception in LogMessagesUC's LogGrid_CustomSummaryCalculate during/after Time Difference calculation #1839
1 parent 7bc47b9 commit b78f1c9

File tree

3 files changed

+12
-3
lines changed

3 files changed

+12
-3
lines changed

Analogy.CommonControls/UserControls/LogMessagesUC.cs

+6-1
Original file line numberDiff line numberDiff line change
@@ -1135,7 +1135,10 @@ private void LogGrid_CustomSummaryCalculate(object sender, CustomSummaryEventArg
11351135
}
11361136
else if (e.SummaryProcess == CustomSummaryProcess.Calculate)
11371137
{
1138-
counts[(string)e.FieldValue] = counts[(string)e.FieldValue] + 1;
1138+
if (e.FieldValue is not null)
1139+
{
1140+
counts[(string)e.FieldValue] += 1;
1141+
}
11391142
}
11401143

11411144
else if (e.SummaryProcess == CustomSummaryProcess.Finalize)
@@ -2970,8 +2973,10 @@ void UpdateTimes()
29702973
_messageData.BeginLoadData();
29712974
foreach (DataRow row in _messageData.Rows)
29722975
{
2976+
row.BeginEdit();
29732977
AnalogyLogMessage message = (AnalogyLogMessage)row[Common.CommonUtils.AnalogyMessageColumn];
29742978
row["TimeDiff"] = Utils.GetOffsetTime(message.Date, Settings.TimeOffsetType, Settings.TimeOffset).Subtract(diffStartTime).ToString();
2979+
row.EndEdit();
29752980
}
29762981

29772982
_messageData.EndLoadData();

Analogy.CommonControls/UserControls/ServerSideLogMessagesUC.cs

+4-1
Original file line numberDiff line numberDiff line change
@@ -870,7 +870,10 @@ private void LogGrid_CustomSummaryCalculate(object sender, CustomSummaryEventArg
870870
}
871871
else if (e.SummaryProcess == CustomSummaryProcess.Calculate)
872872
{
873-
counts[(string)e.FieldValue] = counts[(string)e.FieldValue] + 1;
873+
if (e.FieldValue is not null)
874+
{
875+
counts[(string)e.FieldValue] += 1;
876+
}
874877
}
875878

876879
else if (e.SummaryProcess == CustomSummaryProcess.Finalize)

Analogy/CommonChangeLog.cs

+2-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,8 @@ public static class CommonChangeLog
88
public static IEnumerable<AnalogyChangeLog> GetChangeLog()
99
{
1010
return new List<AnalogyChangeLog>
11-
{
11+
{
12+
new ("V5.0.0 - Exception in LogMessagesUC's LogGrid_CustomSummaryCalculate during/after Time Difference calculation #1839", AnalogChangeLogType.Bug,"Lior Banai",new DateTime(2023,09,05),"5.0.0.0"),
1213
new ("V5.0.0 - Multiple LoadJson calls #1831", AnalogChangeLogType.Bug,"Lior Banai",new DateTime(2023,09,05),"5.0.0.0"),
1314
new ("V5.0.0 - Disable Updates If Running from Program Data Folder #1841", AnalogChangeLogType.Improvement,"Lior Banai",new DateTime(2023,09,05),"5.0.0.0"),
1415
new ("V5.0.0 - Support running from MSI Installer #1838", AnalogChangeLogType.Improvement,"Lior Banai",new DateTime(2023,09,03),"5.0.0.0"),

0 commit comments

Comments
 (0)