Added defense code to CompareTo if Value or other is null.

Value or other is null will cause null reference excpetion