fix(web): Check addKeyboards() for empty args

This commit is contained in:
Darcy Wong 2021-07-26 09:42:16 +07:00
parent 5d1a652314
commit d60954ef81

View file

@ -323,7 +323,7 @@ namespace com.keyman {
*/
async ['addKeyboards'](...args: any[]) :
Promise<(com.keyman.keyboards.KeyboardStub|com.keyman.keyboards.ErrorStub)[]> {
if (args[0].length == 0) {
if (!args || !args[0] || args[0].length == 0) {
// Get the cloud keyboard catalog
let stubs: (com.keyman.keyboards.KeyboardStub|com.keyman.keyboards.ErrorStub)[] = [];
try {