Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NullReferenceException when using the data visualizer on a Serilog/Clef log file #189

Closed
Numpsy opened this issue Jun 16, 2020 · 3 comments
Assignees
Labels
bug Something isn't working

Comments

@Numpsy
Copy link

Numpsy commented Jun 16, 2020

Describe the bug
I was viewing a Serilog/Clef log file and tried using the data visualizer tool.
When I tried changing to the Pies tab, a message box popped up about a NullReferenceException with the call stack

Error: System.NullReferenceException: Object reference not set to an instance of an object.

   at Analogy.LogStatistics.<>c__DisplayClass14_0.<CalculateSingleStatistics>b__0(AnalogyLogMessage m) in E:\files\Programming\Analogy.Core\Analogy\Types\LogStatistics.cs:line 54
   at System.Linq.Enumerable.Count[TSource](IEnumerable`1 source, Func`2 predicate)
   at Analogy.LogStatistics.CalculateSingleStatistics(String module) in E:\files\Programming\Analogy.Core\Analogy\Types\LogStatistics.cs:line 54
   at Analogy.LogStatistics.CalculateModulesStatistics()+MoveNext() in E:\files\Programming\Analogy.Core\Analogy\Types\LogStatistics.cs:line 46
   at System.Collections.Generic.EnumerableHelpers.ToArray[T](IEnumerable`1 source, Int32& length)
   at System.Linq.Buffer`1..ctor(IEnumerable`1 source)
   at System.Linq.OrderedEnumerable`1.ToList()
   at System.Linq.Enumerable.ToList[TSource](IEnumerable`1 source)
   at Philips.Analogy.LogStatisticsUC.PopulateModule() in E:\files\Programming\Analogy.Core\Analogy\UserControls\LogStatisticsUC.cs:line 57
   at Philips.Analogy.LogStatisticsUC.LoadStatistics() in E:\files\Programming\Analogy.Core\Analogy\UserControls\LogStatisticsUC.cs:line 52
   at Philips.Analogy.LogStatisticsUC.LogStatisticsUC_Load(Object sender, EventArgs e) in E:\files\Programming\Analogy.Core\Analogy\UserControls\LogStatisticsUC.cs:line 43
   at System.Windows.Forms.UserControl.OnLoad(EventArgs e)
   at System.Windows.Forms.UserControl.OnCreateControl()
   at System.Windows.Forms.Control.CreateControl(Boolean fIgnoreVisible)
   at System.Windows.Forms.Control.CreateControl(Boolean fIgnoreVisible)
   at System.Windows.Forms.Control.CreateControl()
   at System.Windows.Forms.Control.SetVisibleCore(Boolean value)
   at DevExpress.XtraTab.XtraTabPage.set_Visible(Boolean value)
   at DevExpress.XtraTab.XtraTabControl.OnSelectedPageChanged(Object sender, ViewInfoTabPageChangedEventArgs e)
   at DevExpress.XtraTab.ViewInfo.BaseTabControlViewInfo.OnSelectedPageChanged(IXtraTabPage prevPage)
   at DevExpress.XtraTab.ViewInfo.BaseTabControlViewInfo.set_SelectedTabPage(IXtraTabPage value)
   at DevExpress.XtraTab.ViewInfo.BaseTabHandler.OnMouseDown(MouseEventArgs e)
   at DevExpress.Utils.Controls.BaseHandler.ProcessEvent(EventType etype, Object args)
   at DevExpress.XtraTab.XtraTabControl.OnMouseDown(MouseEventArgs e)
   at System.Windows.Forms.Control.WmMouseDown(Message& m, MouseButtons button, Int32 clicks)
   at System.Windows.Forms.Control.WndProc(Message& m)
   at DevExpress.Utils.Controls.ControlBase.WndProc(Message& m)
   at DevExpress.XtraTab.XtraTabControl.WndProc(Message& m)
   at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)

Looking at the source code that the error points to, I wonder if the issue is that the Module property on the log events is null as the Clef parser hasn't set it to anything?

To Reproduce
Open a Serilog/Clef file with the Serilog parser.
Click the Data Visualizer button on the Logs tab.
Change to the Pies tab on the Visualizer dialog

Result: an error message box pops up.

Expected behavior
I don't expect any error messages.

Desktop (please complete the following information):
Windows 10 64bit, Log Viewer 4.2.1.0 on .Net Core.

@LiorBanai
Copy link
Member

LiorBanai commented Jun 17, 2020

Thanks for reporting.
I'll check this out.

Edit:I can reproduce it and will fix it soon :)

@LiorBanai LiorBanai self-assigned this Jun 17, 2020
@LiorBanai LiorBanai added the bug Something isn't working label Jun 17, 2020
@LiorBanai
Copy link
Member

btw, you are right, Module/Source properties are indeed null as the Clef parser hasn't set it to anything

LiorBanai added a commit to Analogy-LogViewer/Analogy.Interfaces that referenced this issue Jun 17, 2020
@LiorBanai
Copy link
Member

I'll release new version over the weekend :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants