Author: amarkhel
Date: 2009-04-29 08:36:01 -0400 (Wed, 29 Apr 2009)
New Revision: 13899
Modified:
trunk/examples/photoalbum/source/web/src/main/java/org/richfaces/photoalbum/manager/Controller.java
Log:
Modified:
trunk/examples/photoalbum/source/web/src/main/java/org/richfaces/photoalbum/manager/Controller.java
===================================================================
---
trunk/examples/photoalbum/source/web/src/main/java/org/richfaces/photoalbum/manager/Controller.java 2009-04-29
11:21:56 UTC (rev 13898)
+++
trunk/examples/photoalbum/source/web/src/main/java/org/richfaces/photoalbum/manager/Controller.java 2009-04-29
12:36:01 UTC (rev 13899)
@@ -278,7 +278,7 @@
}
public boolean isUserShelf(Shelf shelf){
- return shelf.isOwner(user);
+ return shelf != null && shelf.isOwner(user);
}
public boolean isUserAlbum(Album album){
@@ -286,15 +286,15 @@
}
private boolean canViewShelf(Shelf shelf) {
- return shelf.isOwner(user);
+ return shelf != null && shelf.isOwner(user);
}
private boolean canViewAlbum(Album album) {
- return album.getShelf().isShared() || album.isOwner(user);
+ return album != null && album.getShelf() != null &&
album.getShelf().isShared() || album.isOwner(user);
}
private boolean canViewImage(Image image) {
- return image.getAlbum().getShelf().isShared() || image.isOwner(user);
+ return image != null && image.getAlbum() != null &&
image.getAlbum().getShelf() != null && image.getAlbum().getShelf().isShared() ||
image.isOwner(user);
}
private void pushEvent(String type, Object... parameters) {