Skip to content

Commit

Permalink
Exception in LogMessagesUC's LogGrid_CustomSummaryCalculate during/af…
Browse files Browse the repository at this point in the history
…ter Time Difference calculation #1839
  • Loading branch information
LiorBanai committed Sep 5, 2023
1 parent 7bc47b9 commit b78f1c9
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 3 deletions.
7 changes: 6 additions & 1 deletion Analogy.CommonControls/UserControls/LogMessagesUC.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1135,7 +1135,10 @@ private void LogGrid_CustomSummaryCalculate(object sender, CustomSummaryEventArg
}
else if (e.SummaryProcess == CustomSummaryProcess.Calculate)
{
counts[(string)e.FieldValue] = counts[(string)e.FieldValue] + 1;
if (e.FieldValue is not null)
{
counts[(string)e.FieldValue] += 1;
}
}

else if (e.SummaryProcess == CustomSummaryProcess.Finalize)
Expand Down Expand Up @@ -2970,8 +2973,10 @@ void UpdateTimes()
_messageData.BeginLoadData();
foreach (DataRow row in _messageData.Rows)
{
row.BeginEdit();
AnalogyLogMessage message = (AnalogyLogMessage)row[Common.CommonUtils.AnalogyMessageColumn];
row["TimeDiff"] = Utils.GetOffsetTime(message.Date, Settings.TimeOffsetType, Settings.TimeOffset).Subtract(diffStartTime).ToString();
row.EndEdit();
}

_messageData.EndLoadData();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -870,7 +870,10 @@ private void LogGrid_CustomSummaryCalculate(object sender, CustomSummaryEventArg
}
else if (e.SummaryProcess == CustomSummaryProcess.Calculate)
{
counts[(string)e.FieldValue] = counts[(string)e.FieldValue] + 1;
if (e.FieldValue is not null)
{
counts[(string)e.FieldValue] += 1;
}
}

else if (e.SummaryProcess == CustomSummaryProcess.Finalize)
Expand Down
3 changes: 2 additions & 1 deletion Analogy/CommonChangeLog.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@ public static class CommonChangeLog
public static IEnumerable<AnalogyChangeLog> GetChangeLog()
{
return new List<AnalogyChangeLog>
{
{
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"),
new ("V5.0.0 - Multiple LoadJson calls #1831", AnalogChangeLogType.Bug,"Lior Banai",new DateTime(2023,09,05),"5.0.0.0"),
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"),
new ("V5.0.0 - Support running from MSI Installer #1838", AnalogChangeLogType.Improvement,"Lior Banai",new DateTime(2023,09,03),"5.0.0.0"),
Expand Down

0 comments on commit b78f1c9

Please sign in to comment.