Auburn / FastNoiseLite

Fast Portable Noise Library - C# C++ C Java HLSL GLSL JavaScript Rust Go

Home Page:http://auburn.github.io/FastNoiseLite/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

PreviewApp: Initializing Value in NumericStepper causes NullReferenceException

fumlig opened this issue · comments

Running the PreviewApp on Linux causes the following exception:

> dotnet run               
Exception in Gtk# callback delegate
  Note: Applications can use GLib.ExceptionManager.UnhandledException to handle the exception.
System.NullReferenceException: Object reference not set to an instance of an object.
   at Gtk.SpinButton.OutputSignalCallback(IntPtr inst, IntPtr gch)
   at GLib.ExceptionManager.RaiseUnhandledException(Exception e, Boolean is_terminal)
   at Gtk.SpinButton.OutputSignalCallback(IntPtr inst, IntPtr gch)
   at Gtk.SpinButton.set_Value(Double value)
   at Eto.GtkSharp.Forms.Controls.NumericStepperHandler.set_Value(Double value)
   at Eto.Forms.NumericStepper.set_Value(Double value)
   at FastNoiseLiteGUI..ctor() in /path/to/FastNoiseLite/PreviewApp/FastNoiseLiteGUI.cs:line 144
   at Program.Main(String[] args) in /path/to/FastNoiseLite/PreviewApp/FastNoiseLiteGUI.cs:line 17

The issue seems to be related to the assignment of the Value field for each NumericStepper. Removing the value assignment avoids the exception:

// before
PreviewWidth = new NumericStepper { Value = previewStartSize.Width, Increment = 128 };

// after
PreviewWidth = new NumericStepper { Increment = 128 };

Did some more digging, this seems to be an issue with Eto on Arch Linux (picoe/Eto#1914 (comment)). Closing this now.