fix(email-composer): fix error when no mail apps (#3347)

When there are no apps installed that can handle "mail" then the "apps" array is returned as `null` from the plugin. Ensure we don't try to call `length` on `null`.
This commit is contained in:
Nick Vanselow 2020-03-22 05:54:00 -04:00 committed by GitHub
parent 52fc9f85ad
commit 7bcbca7696
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -198,7 +198,7 @@ export class EmailComposer extends IonicNativePlugin {
});
} else {
EmailComposer.getPlugin().getClients((apps: string[]) => {
resolve(apps.length && apps.length > 0);
resolve(apps && apps.length > 0);
});
}
});