Validate task name in API

This commit is contained in:
Zaid Abdulla committed 2021-02-23 13:31:32 -08:00
1 parent 5b17d1b2ca
commit 111cb106d0
1 file changed
+9
+9
View File
@@ -296,6 +296,15 @@ function sanitizeTask(task): void {
)
throw new Error("Invalid 'provisions' property");
break;
case "reboot":
break;
case "factoryReset":
break;
default:
throw new Error("Invalid task name");
}
return task;