Просмотр исходного кода

do nothing if specificSources is falsy

Casey Holzer 9 лет назад
Родитель
Сommit
f86f9f247e
1 измененных файлов с 6 добавлено и 4 удалено
  1. 6 4
      src/Calendar.js

+ 6 - 4
src/Calendar.js

@@ -707,11 +707,13 @@ function Calendar_constructor(element, overrides) {
 
 
 	function refetchEventSources(specificSources, shouldClearAll) {
-		// if specificSources isn't an array (i.e. one event source), add it to an array
-		if (specificSources && !$.isArray(specificSources)) {
-			specificSources = [ specificSources ];
+		if (specificSources) {
+			// if specificSources isn't an array (i.e. one event source), add it to an array
+			if (!$.isArray(specificSources)) {
+				specificSources = [ specificSources ];
+			}
+			fetchEventSources(specificSources, shouldClearAll);
 		}
-		fetchEventSources(specificSources, shouldClearAll);
 	}