Skip to content

Fix simulator identifier not verified before startEmulator. #92

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Aug 14, 2017

Conversation

KristianDD
Copy link
Contributor

Part of the fix for NativeScript/nativescript-cli#2728. Now an exception is thrown if no simulator image is available for the specified identifier.

private verifyDevice(device?: IDevice): void {
const availableDevices = this.getDevices();

if(_.find(availableDevices, { id: device.id })){
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would invert the if:

if(!_.find(availableDevices, { id: device.id })) {
    errors.fail(`No simulator image available for device identifier '${device.id}'.`);
}

This way you can skip the return inside the method.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point.

@KristianDD KristianDD force-pushed the kddimitrov/fix-no-device-identifier-check branch from d17db2c to fc89f28 Compare July 31, 2017 14:04
@KristianDD KristianDD force-pushed the kddimitrov/fix-no-device-identifier-check branch from fc89f28 to 12f123a Compare July 31, 2017 14:06
@rosen-vladimirov rosen-vladimirov merged commit b80923b into master Aug 14, 2017
@rosen-vladimirov rosen-vladimirov deleted the kddimitrov/fix-no-device-identifier-check branch August 14, 2017 08:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants