pxt.commands null check

This commit is contained in:
Guillaume Jenkins 2018-06-14 13:40:19 -04:00
parent bb4966dca7
commit 068eb7017f

View File

@ -98,10 +98,10 @@ export function deployCoreAsync(resp: pxtc.CompileResult, isCli = false) {
resp.outfiles[pxtc.BINARY_UF2] = btoa(data)
let saveUF2Async = () => {
if (pxt.commands.electronDeployAsync) {
if (pxt.commands && pxt.commands.electronDeployAsync) {
return pxt.commands.electronDeployAsync(resp);
}
if (!isCli && pxt.commands.saveOnlyAsync) {
if (!isCli && pxt.commands && pxt.commands.saveOnlyAsync) {
return pxt.commands.saveOnlyAsync(resp);
}
return Promise.resolve();