Skip to content

Commit 43223d8

Browse files
committed
fix(ImageLoader Provider): do not attempt to fetch invalid url
closes #76
1 parent fd4cd8e commit 43223d8

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/providers/image-loader.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -163,6 +163,11 @@ export class ImageLoader {
163163
* @returns {Promise<string>} Returns a promise that will always resolve with an image URL
164164
*/
165165
getImagePath(imageUrl: string): Promise<string> {
166+
167+
if (typeof imageUrl !== 'string' || imageUrl.length <= 0) {
168+
return Promise.reject('The image url provided was empty or invalid.');
169+
}
170+
166171
return new Promise<string>((resolve, reject) => {
167172

168173
const getImage = () => {

0 commit comments

Comments
 (0)