Fix comparison of null DisplayModes.
Turns out we do not need the (object) cast.
Merge pull request #1801 from flibitijibibo/displaymode-comparison

Fix comparison of null DisplayModes.