UltravioletFramework / ultraviolet

The Ultraviolet Framework is a .NET game development framework written in C#.
https://github.com/UltravioletFramework/ultraviolet/wiki
MIT License
541 stars 46 forks source link

Fix NullReferenceException when the system cursor is used #113

Closed SpacialCircumstances closed 5 years ago

SpacialCircumstances commented 5 years ago

When no cursor is set (so the system cursor is used), the EditBox throws a NullReferenceException because it tries to access the resource of the system cursor - which has no resource.

This pull request fixes the issue without breaking the normal behaviour.

If you want to verify that this works, my fork contains a branch system-cursor before and after the fix (which is the last commit) and a branch uv-cursor before and after the fix (which is also the last commit) so you can verify that this change does not break old behaviour and fixes the NRE.

tlgkccampbell commented 5 years ago

I went ahead and removed the redundant conditional myself. Thanks for the contribution!