diff --git a/index.js b/index.js index 2ddf780..65cb589 100644 --- a/index.js +++ b/index.js @@ -26,7 +26,8 @@ function resolveImageSrc(loaderContext, image, callback) { // Update the image src property to match the generated filename // Is it always the first key in the assets object? - image.src = Object.keys(module.assets)[0]; + if(module.assets) + image.src = Object.keys(module.assets)[0]; callback(null); });