MBED_DEMOS / Mbed 2 deprecated mbed_mqtt_endpoint_ublox_ethernet

Dependencies:   C027 C12832 EthernetInterface StatusReporter LM75B MQTT-ansond endpoint_core endpoint_mqtt mbed-rtos mbed

Revision:
52:d1aaf4c7fd6a
Parent:
47:081874a5d049
Child:
74:4c8bf308383e
--- a/EmulatedResourceFactory.cpp	Sun Mar 02 17:17:30 2014 +0000
+++ b/EmulatedResourceFactory.cpp	Sun Mar 02 17:55:47 2014 +0000
@@ -89,11 +89,11 @@
      MBEDEndpoint *endpoint = (MBEDEndpoint *)this->m_endpoint;
      char *ep_name = NULL; if (endpoint != NULL) ep_name = endpoint->getEndpointName();
      this->m_list[this->m_count] = new Resource(this->logger(),ep_name,name,value,NULL);
-     if (io != NULL) {
+     if (io != NULL && this->m_list[this->m_count] != NULL) {
         resourceInitializer initializer = (resourceInitializer)io;
         (initializer)(this->m_list[this->m_count]);
      }
-     ++this->m_count;
+     if (this->m_list[this->m_count] != NULL) ++this->m_count;
  }
   
  // set a resource value (AND trigger the Emulated actions if registered)