summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPouleyKetchoupp <pouleyketchoup@gmail.com>2019-11-30 20:20:01 +0100
committerPouleyKetchoupp <pouleyketchoup@gmail.com>2020-07-01 10:17:27 +0200
commit45445e1b3164669989b18aa2c492c6afae832641 (patch)
tree9e0f6b8754073f8da7b307e1fa3c2c10c09ba7dd
parent719609522a30fa9e3b96b028ac5a1d1a65f1678f (diff)
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.
-rw-r--r--core/list.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/core/list.h b/core/list.h
index 6052a619fb..f850db5241 100644
--- a/core/list.h
+++ b/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) {