Skip to content

Commit f78004f

Browse files
Fix adding of invalid platform
When user tries to add invalid platform, CLI should prints user-friendly message. Instead it fails that cannot read `getPlatformData` of `undefined`. The reason is a change in platforms-data `getPlatformsData` method. Fix it to return undefined when there's no platform specific data. This way the code will detect the invalid platform and will fail with user-friendly message.
1 parent 8f9c273 commit f78004f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/platforms-data.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ export class PlatformsData implements IPlatformsData {
1515
}
1616

1717
public getPlatformData(platform: string, projectData: IProjectData): IPlatformData {
18-
return this.platformsData[platform.toLowerCase()].getPlatformData(projectData);
18+
return this.platformsData[platform.toLowerCase()] && this.platformsData[platform.toLowerCase()].getPlatformData(projectData);
1919
}
2020

2121
public get availablePlatforms(): any {

0 commit comments

Comments
 (0)