From 2f27b5df8cc37d047ff93bf842c856c97ad74170 Mon Sep 17 00:00:00 2001 From: Kyle Carberry Date: Fri, 15 Mar 2019 00:51:05 -0400 Subject: [PATCH] Fix #251 --- packages/ide/src/fill/electron.ts | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/packages/ide/src/fill/electron.ts b/packages/ide/src/fill/electron.ts index bbd401b5a..65e70546f 100644 --- a/packages/ide/src/fill/electron.ts +++ b/packages/ide/src/fill/electron.ts @@ -46,7 +46,9 @@ const newCreateElement = (tagName: K): HT return oldSrc!.get!.call(img); }, set: (value: string): void => { - value = value.replace(/file:\/\//g, "/resource"); + if (value) { + value = value.replace(/file:\/\//g, "/resource"); + } oldSrc!.set!.call(img, value); }, }); @@ -65,7 +67,9 @@ const newCreateElement = (tagName: K): HT return oldInnerHtml!.get!.call(style); }, set: (value: string): void => { - value = value.replace(/file:\/\//g, "/resource"); + if (value) { + value = value.replace(/file:\/\//g, "/resource"); + } oldInnerHtml!.set!.call(style, value); }, });