diff --git a/library.json b/library.json index 0c26f3cd0..1eef2bd7f 100644 --- a/library.json +++ b/library.json @@ -12,7 +12,7 @@ "type": "git", "url": "https://github.com/me-no-dev/ESPAsyncWebServer.git" }, - "version": "2.0.5", + "version": "2.0.6", "license": "LGPL-3.0", "frameworks": "arduino", "platforms": ["espressif8266", "espressif32"], diff --git a/library.properties b/library.properties index ed722e46f..3b5e33440 100644 --- a/library.properties +++ b/library.properties @@ -1,5 +1,5 @@ name=ESP Async WebServer -version=2.0.5 +version=2.0.6 author=Me-No-Dev maintainer=Me-No-Dev sentence=Async Web Server for ESP8266 and ESP31B (Aircoookie fork) diff --git a/src/StringArray.h b/src/StringArray.h index 4c0aa7019..74cca4ba5 100644 --- a/src/StringArray.h +++ b/src/StringArray.h @@ -47,10 +47,19 @@ class LinkedList { class Iterator { ItemType* _node; + ItemType* _nextNode = nullptr; public: - Iterator(ItemType* current = nullptr) : _node(current) {} - Iterator(const Iterator& i) : _node(i._node) {} - Iterator& operator ++() { _node = _node->next; return *this; } + Iterator(ItemType* current = nullptr) : _node(current) { + _nextNode = _node != nullptr ? _node->next : nullptr; + } + Iterator(const Iterator& i) : _node(i._node) { + _nextNode = _node != nullptr ? _node->next : nullptr; + } + Iterator& operator ++() { + _node = _nextNode; + _nextNode = _node != nullptr ? _node->next : nullptr; + return *this; + } bool operator != (const Iterator& i) const { return _node != i._node; } const T& operator * () const { return _node->value(); } const T* operator -> () const { return &_node->value(); }