From cc633a7c851e36161315bc1119ed11fc18348c9c Mon Sep 17 00:00:00 2001 From: Lukas Bachschwell Date: Sun, 13 May 2018 19:39:21 +0200 Subject: [PATCH] Closes #11 Bugfix for retrun values on error --- src/ESPUI.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/ESPUI.cpp b/src/ESPUI.cpp index db2a1e7..d266a83 100644 --- a/src/ESPUI.cpp +++ b/src/ESPUI.cpp @@ -257,7 +257,7 @@ int ESPUIClass::label(const char *label, int color, String value) { if (debug) Serial.println("UI ERROR: Element " + String(label) + " exists, skipping creating element!"); - return; + return -1; } Control *newL = new Control(); @@ -282,7 +282,7 @@ int ESPUIClass::slider(const char *label, void (*callBack)(Control, int), if (debug) Serial.println("UI ERROR: Element " + String(label) + " exists, skipping creating element!"); - return; + return -1; } Control *newSL = new Control(); @@ -306,7 +306,7 @@ int ESPUIClass::button(const char *label, void (*callBack)(Control, int), if (debug) Serial.println("UI ERROR: Element " + String(label) + " exists, skipping creating element!"); - return; + return -1; } Control *newB = new Control(); @@ -332,7 +332,7 @@ int ESPUIClass::switcher(const char *label, bool startState, if (debug) Serial.println("UI ERROR: Element " + String(label) + " exists, skipping creating element!"); - return; + return -1; } Control *newS = new Control(); @@ -353,7 +353,7 @@ int ESPUIClass::pad(const char *label, bool center, if (debug) Serial.println("UI ERROR: Element " + String(label) + " exists, skipping creating element!"); - return; + return -1; } Control *newP = new Control();