Bug 59393 - NullReferenceException when MonthCalendar clicked out of min/max date
Summary: NullReferenceException when MonthCalendar clicked out of min/max date
Status: RESOLVED FIXED
Alias: None
Product: Class Libraries
Classification: Mono
Component: Windows.Forms (show other bugs)
Version: master
Hardware: PC Windows
: --- normal
Target Milestone: Untriaged
Assignee: Bugzilla
URL:
Depends on:
Blocks:
 
Reported: 2017-09-11 15:54 UTC by Alexander Ivanov
Modified: 2017-10-11 07:44 UTC (History)
2 users (show)

See Also:
Tags:
Is this bug a regression?: ---
Last known good build:


Attachments

Description Alexander Ivanov 2017-09-11 15:54:43 UTC
There is problem with order of operations: https://github.com/mono/mono/blob/master/mcs/class/System.Windows.Forms/System.Windows.Forms/MonthCalendar.cs#L1604

 if (range != null && range.Start != selection_range.Start || range.End != selection_range.End)

When range is null, NullReferenceException fired at "range.End".

This should be patched like 

 if (range != null && (range.Start != selection_range.Start || range.End != selection_range.End))

Note You need to log in before you can comment on or make changes to this bug.