Index: sdk/lib/collection/linked_list.dart |
diff --git a/sdk/lib/collection/linked_list.dart b/sdk/lib/collection/linked_list.dart |
index 481f04dde02fd599b8d9ac36d131cb1e360c221b..f1b55bb877482f637e433d3fdf597c5ec8757f40 100644 |
--- a/sdk/lib/collection/linked_list.dart |
+++ b/sdk/lib/collection/linked_list.dart |
@@ -258,13 +258,13 @@ abstract class LinkedListEntry<E extends LinkedListEntry<E>> { |
} |
/** |
- * Return the succeessor of this element in its linked list. |
+ * Return the successor of this element in its linked list. |
Lasse Reichstein Nielsen
2016/05/26 15:24:10
Poor "e" doesn't get to be duplicated like all the
|
* |
* Returns `null` if there is no successor in the linked list, or if this |
* entry is not currently in any list. |
*/ |
E get next { |
- if (identical(this, _next)) return null; |
+ if (_list == null || identical(_list.first, _next)) return null; |
return _next; |
} |
@@ -275,7 +275,7 @@ abstract class LinkedListEntry<E extends LinkedListEntry<E>> { |
* entry is not currently in any list. |
*/ |
E get previous { |
- if (identical(this, _previous)) return null; |
+ if (_list == null || identical(this, _list.first)) return null; |
return _previous; |
} |