spiegelp / MaterialDesignExtensions

Material Design Extensions is based on Material Design in XAML Toolkit to provide additional controls and features for WPF apps
https://spiegelp.github.io/MaterialDesignExtensions/
MIT License
766 stars 123 forks source link

Fixed issue: #153: OversizedNumberSpinner Throws NullReferenceException. #154

Closed whopacha closed 8 months ago

whopacha commented 3 years ago

Added Null checks for m_valueTextBox in LoadedHandler and UnloadedHandler.

whopacha commented 3 years ago

Using MaterialDesignExtensions 3.3.0 I was getting:

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

When using the OversizedNumberSpinner control inside a tab control (that isn't the first loaded tab) Adding null checks to the Load and Unload handlers in OversizedNumberSpinner.cs correct the issue.

Note: This is my first attempt at contributing to something on Github so I'm sorry if I didn't follow expected processes correctly or anything.