diff --git a/examples/demos/photoviewer/PhotoViewerCore/script/script.mjs b/examples/demos/photoviewer/PhotoViewerCore/script/script.mjs
index 1eb7cac7ed84631e106f8b9b0d12c9b66e1fd09f..a1822197ba7e2072e5808cf6446ac3e68e7cb3fe 100644
--- a/examples/demos/photoviewer/PhotoViewerCore/script/script.mjs
+++ b/examples/demos/photoviewer/PhotoViewerCore/script/script.mjs
@@ -57,8 +57,9 @@ export function getHeight(string) {
 }
 
 export function getImagePath(string) {
-    var pattern = /src=\"http:\/\/(\S+)\"/
-    return (string.match(pattern))[1]
+    var pattern = /src=\"https?:\/\/(\S+)\"/
+    var match = string.match(pattern)
+    return match ? match[1] : ""
 }
 
 export function calculateScale(width, height, cellSize) {