Browse Source

Removed errors when List::erase() can't find the value

This change makes the behavior consistent when the value
is not found between erasing from an empty list
(no error, just returning false) and erasing from a non-empty list
(previously displaying triggering an error and returning false).

Error message previously triggered:
ERROR: erase: Condition ' !p_I ' is true. returned: false
   At: ./core/list.h:157.
PouleyKetchoupp 5 years ago
parent
commit
45445e1b31
1 changed files with 1 additions and 1 deletions
  1. 1 1
      core/list.h

+ 1 - 1
core/list.h

@@ -348,7 +348,7 @@ public:
 	 * erase an element in the list, by iterator pointing to it. Return true if it was found/erased.
 	 */
 	bool erase(const Element *p_I) {
-		if (_data) {
+		if (_data && p_I) {
 			bool ret = _data->erase(p_I);
 
 			if (_data->size_cache == 0) {