       IrSendTable[i] = NULL;
     } else {
       IrSendTable[i] = new IRsend(txGpioTable[i]);
+      if (IrSendTable[i] == NULL) break;
       IrSendTable[i]->begin();
       offset = IrSendTable[i]->calibrate();
     }

  // constructing the PUBLISH packet.
  // Allocate the correct amount of memory for the payload copy
  byte* payload_copy = reinterpret_cast<byte*>(malloc(length + 1));
  // Copy the payload to the new buffer
  memcpy(payload_copy, payload, length);


  climate.clock = -1;  // Don't set.
  climate_prev = climate;
  lastClimateSource = F("None");

#if DEBUG
  if (!isSerialGpioUsedByIr()) {
