Explorar o código

safeguard against gcal htmlLink not being given (#2844)

Adam Shaw %!s(int64=9) %!d(string=hai) anos
pai
achega
7dc98d9008
Modificáronse 1 ficheiros con 2 adicións e 2 borrados
  1. 2 2
      src/gcal/gcal.js

+ 2 - 2
src/gcal/gcal.js

@@ -136,10 +136,10 @@ function transformOptions(sourceOptions, start, end, timezone, calendar) {
 			}
 			}
 			else if (data.items) {
 			else if (data.items) {
 				$.each(data.items, function(i, entry) {
 				$.each(data.items, function(i, entry) {
-					var url = entry.htmlLink;
+					var url = entry.htmlLink || null;
 
 
 					// make the URLs for each event show times in the correct timezone
 					// make the URLs for each event show times in the correct timezone
-					if (timezoneArg) {
+					if (timezoneArg && url !== null) {
 						url = injectQsComponent(url, 'ctz=' + timezoneArg);
 						url = injectQsComponent(url, 'ctz=' + timezoneArg);
 					}
 					}