- var bcElements = breadcrumbs.getElementsByTagName('a');
- this.lastBCElement = bcElements[bcElements.length-1];
- var imgSrcParts = image.src.split('/');
- this.lastBCElement.innerHTML = imgSrcParts[imgSrcParts.length-2];
+ if (breadcrumbs) {
+ var bcElements = breadcrumbs.getElementsByTagName('a');
+ this.lastBCElement = bcElements[bcElements.length-1];
+ var imgSrcParts = image.src.split('/');
+ this.lastBCElement.innerHTML = imgSrcParts[imgSrcParts.length-2];
+ this.hasBreadcrumbs = true;
+ }
+ else {
+ this.hasBreadcrumbs = false;
+ }