Skip to content

FormsPlot null reference exception in .NET Core 3.0 #138

@petarpetrovt

Description

@petarpetrovt

Creating new FormsPlot throws null reference exception.

Version:
NuGet package: 3.1.4

SDK:
dotnet core 3.0.100

Code:
this.FormsPlot = new ScottPlot.FormsPlot();

CallStack:

   at ScottPlot.FormsPlot.Render(Boolean skipIfCurrentlyRendering, Boolean lowQuality)
   at ScottPlot.FormsPlot.PbPlot_SizeChanged(Object sender, EventArgs e)
   at System.Windows.Forms.Control.OnSizeChanged(EventArgs e)
   at System.Windows.Forms.Control.UpdateBounds(Int32 x, Int32 y, Int32 width, Int32 height, Int32 clientWidth, Int32 clientHeight)
   at System.Windows.Forms.Control.UpdateBounds(Int32 x, Int32 y, Int32 width, Int32 height)
   at System.Windows.Forms.Control.SetBoundsCore(Int32 x, Int32 y, Int32 width, Int32 height, BoundsSpecified specified)
   at System.Windows.Forms.Control.ScaleControl(SizeF factor, BoundsSpecified specified)
   at System.Windows.Forms.Control.ScaleControl(SizeF includedFactor, SizeF excludedFactor, Control requestingControl)
   at System.Windows.Forms.Control.Scale(SizeF includedFactor, SizeF excludedFactor, Control requestingControl)
   at System.Windows.Forms.Control.ScaleChildControls(SizeF includedFactor, SizeF excludedFactor, Control requestingControl, Boolean updateWindowFontIfNeeded)
   at System.Windows.Forms.ContainerControl.Scale(SizeF includedFactor, SizeF excludedFactor, Control requestingControl)
   at System.Windows.Forms.ContainerControl.PerformAutoScale(Boolean includedBounds, Boolean excludedBounds)
   at System.Windows.Forms.ContainerControl.PerformNeededAutoScaleOnLayout()
   at System.Windows.Forms.ContainerControl.OnLayoutResuming(Boolean performLayout)
   at System.Windows.Forms.Control.ResumeLayout(Boolean performLayout)
   at ScottPlot.FormsPlot.InitializeComponent()
   at ScottPlot.FormsPlot..ctor()
   at WindowsFormsApp1.Form1.InitializeComponent() in C:\Projects\sharpa\test\WindowsFormsApp1\Form1.Designer.cs:line 33
   at WindowsFormsApp1.Form1..ctor() in C:\Projects\sharpa\test\WindowsFormsApp1\Form1.cs:line 17
   at WindowsFormsApp1.Program.Main() in C:\Projects\sharpa\test\WindowsFormsApp1\Program.cs:line 20

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions