r7217 - dumbhippo/trunk/server/src/com/dumbhippo/server/impl



Author: marinaz
Date: 2008-01-15 21:49:01 -0600 (Tue, 15 Jan 2008)
New Revision: 7217

Modified:
   dumbhippo/trunk/server/src/com/dumbhippo/server/impl/ExternalAccountSystemBean.java
Log:
Don't try to set thumbnails data when YouTube videos or Picasa albums are null.

Modified: dumbhippo/trunk/server/src/com/dumbhippo/server/impl/ExternalAccountSystemBean.java
===================================================================
--- dumbhippo/trunk/server/src/com/dumbhippo/server/impl/ExternalAccountSystemBean.java	2008-01-16 03:21:47 UTC (rev 7216)
+++ dumbhippo/trunk/server/src/com/dumbhippo/server/impl/ExternalAccountSystemBean.java	2008-01-16 03:49:01 UTC (rev 7217)
@@ -228,9 +228,11 @@
 		ExternalAccount externalAccount = accountView.getExternalAccount();
 		
 		List<? extends YouTubeVideo> videos = getYouTubeThumbnails(externalAccount);
-
+		if (videos == null)
+			return;
+		
 		accountView.setThumbnailsData(TypeUtils.castList(Thumbnail.class, videos), videos.size(), 
-				videos.get(0).getThumbnailWidth(), videos.get(0).getThumbnailHeight());
+			     	                  videos.get(0).getThumbnailWidth(), videos.get(0).getThumbnailHeight());
 	}
 
 	private List<? extends PicasaAlbum> getPicasaThumbnails(ExternalAccount account) {
@@ -262,10 +264,12 @@
 	private void loadPicasaThumbnails(Viewpoint viewpoint, ExternalAccountView accountView) {
 		ExternalAccount externalAccount = accountView.getExternalAccount();
 		
-		List<? extends PicasaAlbum> videos = getPicasaThumbnails(externalAccount);
-
-		accountView.setThumbnailsData(TypeUtils.castList(Thumbnail.class, videos), videos.size(), 
-				videos.get(0).getThumbnailWidth(), videos.get(0).getThumbnailHeight());
+		List<? extends PicasaAlbum> albums = getPicasaThumbnails(externalAccount);	
+		if (albums == null)
+			return;
+		
+		accountView.setThumbnailsData(TypeUtils.castList(Thumbnail.class, albums), albums.size(), 
+	             			          albums.get(0).getThumbnailWidth(), albums.get(0).getThumbnailHeight());
 	}
 
 	public List<? extends Thumbnail> getThumbnails(ExternalAccount externalAccount) {



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]