Skip to content

Commit

Permalink
fix(ImageLoader Provider): do not attempt to fetch invalid url
Browse files Browse the repository at this point in the history
closes #76
  • Loading branch information
ihadeed committed Jul 16, 2017
1 parent fd4cd8e commit 43223d8
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/providers/image-loader.ts
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,11 @@ export class ImageLoader {
* @returns {Promise<string>} Returns a promise that will always resolve with an image URL
*/
getImagePath(imageUrl: string): Promise<string> {

if (typeof imageUrl !== 'string' || imageUrl.length <= 0) {
return Promise.reject('The image url provided was empty or invalid.');
}

return new Promise<string>((resolve, reject) => {

const getImage = () => {
Expand Down

0 comments on commit 43223d8

Please sign in to comment.