[pal-cvs 2851] [596] check npe

svnno****@sourc***** svnno****@sourc*****
2007年 9月 29日 (土) 16:02:25 JST


Revision: 596
          http://svn.sourceforge.jp/cgi-bin/viewcvs.cgi?root=pal&view=rev&rev=596
Author:   shinsuke
Date:     2007-09-29 16:02:24 +0900 (Sat, 29 Sep 2007)

Log Message:
-----------
check npe

Modified Paths:
--------------
    pompei/portlets/pompei-core/trunk/src/main/java/jp/sf/pal/pompei/web/user/product/ProductDetailsAction.java


-------------- next part --------------
Modified: pompei/portlets/pompei-core/trunk/src/main/java/jp/sf/pal/pompei/web/user/product/ProductDetailsAction.java
===================================================================
--- pompei/portlets/pompei-core/trunk/src/main/java/jp/sf/pal/pompei/web/user/product/ProductDetailsAction.java	2007-09-29 07:01:57 UTC (rev 595)
+++ pompei/portlets/pompei-core/trunk/src/main/java/jp/sf/pal/pompei/web/user/product/ProductDetailsAction.java	2007-09-29 07:02:24 UTC (rev 596)
@@ -46,6 +46,10 @@
     }
 
     public Class<?> prerender() {
+        if (getProductDetailsPage().getProductId() == null) {
+            return ProductListPage.class;
+        }
+
         // check login
         String remoteUser = FacesContext.getCurrentInstance()
                 .getExternalContext().getRemoteUser();
@@ -66,7 +70,7 @@
         }
 
         ProductDescription description = productService
-                .getProdcutsDescription(productDetailsPage.getProductId());
+                .getProdcutsDescription(getProductDetailsPage().getProductId());
         productDxo.convert(description, productDetailsPage);
 
         Manufacturer manufacturers = productService.getManufacturer(description


pal-cvs メーリングリストの案内