added check to display only when slider contains images master
added check to display only when slider contains images

--- a/owl.carousel.js
+++ b/owl.carousel.js
@@ -308,7 +308,10 @@
                 lastItem = base.itemsAmount - base.options.items;
 
             base.$owlItems.each(function (index) {
-                base.titles[index] = $(this).find('img').attr ('alt');
+                var alt = $(this).find('img').attr ('alt');
+                if ( alt ) {
+                    base.titles[index] = alt;
+                }
                 var $this = $(this);
                 $this
                     .css({"width": base.itemWidth})
@@ -419,14 +422,16 @@
                 "html" : base.options.navigationText[1] || ""
             });
 
+			if ( base.titles.length == 0 ) {base.userOptions.showTitles = false;}
+
             buttonsWrapper
                 .append(base.buttonPrev)
-                .append( base.userOptions.showTitles ? '<span id="currTitle">'+base.titles[ base.currentItem ]+'</span>' : '' )
+                .append(base.userOptions.showTitles ? '<span id="currTitle">'+base.titles[ base.currentItem ]+'</span>' : '')
                 .append(base.buttonNext);
 
 			if ( base.userOptions.showTitles ) {
-				buttonsWrapper.prepend ( '<span id="prevTitle">'+((base.currentItem > 0) ? base.titles[ (base.currentItem-1) ]  : base.titles[(base.itemsAmount-1)])+'</span>' );
-				buttonsWrapper.append ( '<span id="nextTitle">'+((base.currentItem < base.itemsAmount) ? base.titles[ (base.currentItem+1) ] : '')+'</span>' );
+				buttonsWrapper.prepend ('<span id="prevTitle">'+((base.currentItem > 0) ? base.titles[ (base.currentItem-1) ]  : base.titles[(base.itemsAmount-1)])+'</span>');
+				buttonsWrapper.append ('<span id="nextTitle">'+((base.currentItem < base.itemsAmount) ? base.titles[ (base.currentItem+1) ] : '')+'</span>');
 				$('#prevTitle').click (function(){base.prev()});
 				$('#nextTitle').click (function(){base.next()});
 			}
@@ -561,9 +566,11 @@
 
         displayTitles : function () {
         	var base = this;
-        	$('#prevTitle').html( ( (base.currentItem > 0) ? base.titles[ (base.currentItem-1) ]  : base.titles[(base.itemsAmount-1)] ) );
-        	$('#currTitle').html( base.titles[ base.currentItem ] );
-        	$('#nextTitle').html( ( (base.currentItem < (base.itemsAmount-1)) ? base.titles[ (base.currentItem+1) ] : base.titles[0]) );
+        	if ( base.userOptions.showTitles ) {
+        		$('#prevTitle').html( ( (base.currentItem > 0) ? base.titles[ (base.currentItem-1) ]  : base.titles[(base.itemsAmount-1)] ) );
+        		$('#currTitle').html( base.titles[ base.currentItem ] );
+        		$('#nextTitle').html( ( (base.currentItem < (base.itemsAmount-1)) ? base.titles[ (base.currentItem+1) ] : base.titles[0]) );
+        	}
         },
 
         next : function (speed) {

comments