From 91f998c4fc09dab7bea21e47a4cf86367bb8c873 Mon Sep 17 00:00:00 2001 From: ivanovit Date: Tue, 29 May 2018 16:16:06 +0300 Subject: [PATCH] Fix assets generation When we don't find asset in the default image definitions(image-definitions.json) we skip width and height parsing. Then the image generation fails. Now we set the correct size even we don't find default asset properties. https://github.com/NativeScript/sidekick-feedback/issues/199 --- lib/services/project-data-service.ts | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/lib/services/project-data-service.ts b/lib/services/project-data-service.ts index a807cc18fe..de5e873d44 100644 --- a/lib/services/project-data-service.ts +++ b/lib/services/project-data-service.ts @@ -143,16 +143,16 @@ export class ProjectDataService implements IProjectDataService { assetElement.filename === image.filename && path.basename(assetElement.directory) === path.basename(dirPath) ); - if (assetItem) { - if (image.size) { - // size is basically x - const [width, height] = image.size.toString().split(AssetConstants.sizeDelimiter); - if (width && height) { - image.width = +width; - image.height = +height; - } + if (image.size) { + // size is basically x + const [width, height] = image.size.toString().split(AssetConstants.sizeDelimiter); + if (width && height) { + image.width = +width; + image.height = +height; } + } + if (assetItem) { if (!image.width || !image.height) { image.width = assetItem.width; image.height = assetItem.height;