   }
 
   uint8_t num = strToInt(queryWithPort);
+
+  error = checkInterruptRange(num);
+  if(error){
+    return error;
+  }
+
   detachInterrupt(num);
 }
 

const prog_char ILLEGAL_TYPE[] PROGMEM          = "Illegal type.";
const prog_char ILLEGAL_QUERY[] PROGMEM         = "Illegal query.";
const prog_char ILLEGAL_VALUE[] PROGMEM         = "Illegal value.";
const prog_char ILLEGAL_PORT_NUMBER[] PROGMEM   = "Illegal port number.";
const prog_char QUERY_NOT_FOUND[] PROGMEM       = "Query not found.";
const prog_char TYPE_IS_NOT_SPECIFIED[] PROGMEM = "type is not specified.";

  return NgReturnJson(ILLEGAL_PORT_NUMBER);
}

char* checkInterruptRange(uint8_t num){
  if(num >= ARRAYSIZE(INTERRUPT_FUNC_TBL)){
    return NgReturnJson(ILLEGAL_INTR_NUMBER);
  }
  return NULL;
}

/**************************************************************************
                        タイマ割り込みに関するｱﾚ
