Skip to content

Commit 9189b7b

Browse files
committed
Prevent Equals from having cast failure exception
1 parent 23ce7df commit 9189b7b

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

RetailCoder.VBE/Settings/ToDoMarkers.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,9 @@ public override string ToString()
5959

6060
public override bool Equals(object obj)
6161
{
62-
var other = (ToDoMarker)obj;
62+
var other = obj as ToDoMarker;
63+
64+
if (other == null) { return false; }
6365

6466
// no need to check PriorityLabel as it soley relies on Priority - if one is wrong, the other has to be too
6567
return Text == other.Text &&

0 commit comments

Comments
 (0)