Explorar o código

Merge pull request #34028 from nekomatata/list-erase-not-found

Removed errors when List::erase() can't find the value
Rémi Verschelde %!s(int64=5) %!d(string=hai) anos
pai
achega
c069f5f5ca
Modificáronse 1 ficheiros con 1 adicións e 1 borrados
  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) {