roller-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From agillil...@apache.org
Subject svn commit: r422077 - /incubator/roller/branches/roller_3.0/src/org/apache/roller/ui/rendering/model/PageModel.java
Date Fri, 14 Jul 2006 22:27:18 GMT
Author: agilliland
Date: Fri Jul 14 15:27:15 2006
New Revision: 422077

URL: http://svn.apache.org/viewvc?rev=422077&view=rev
Log:
only return entry and category if they exist.


Modified:
    incubator/roller/branches/roller_3.0/src/org/apache/roller/ui/rendering/model/PageModel.java

Modified: incubator/roller/branches/roller_3.0/src/org/apache/roller/ui/rendering/model/PageModel.java
URL: http://svn.apache.org/viewvc/incubator/roller/branches/roller_3.0/src/org/apache/roller/ui/rendering/model/PageModel.java?rev=422077&r1=422076&r2=422077&view=diff
==============================================================================
--- incubator/roller/branches/roller_3.0/src/org/apache/roller/ui/rendering/model/PageModel.java
(original)
+++ incubator/roller/branches/roller_3.0/src/org/apache/roller/ui/rendering/model/PageModel.java
Fri Jul 14 15:27:15 2006
@@ -112,8 +112,11 @@
     /**
      * Get weblog entry being displayed or null if none specified by request.
      */
-    public WeblogEntryDataWrapper getWeblogEntry() {  
-        return WeblogEntryDataWrapper.wrap(pageRequest.getWeblogEntry());
+    public WeblogEntryDataWrapper getWeblogEntry() {
+        if(pageRequest.getWeblogEntry() != null) {
+            return WeblogEntryDataWrapper.wrap(pageRequest.getWeblogEntry());
+        }
+        return null;
     }
     
     
@@ -139,7 +142,10 @@
      * found in the request does not exist in the current weblog.
      */
     public WeblogCategoryDataWrapper getWeblogCategory() {
-        return WeblogCategoryDataWrapper.wrap(pageRequest.getWeblogCategory());
+        if(pageRequest.getWeblogCategory() != null) {
+            return WeblogCategoryDataWrapper.wrap(pageRequest.getWeblogCategory());
+        }
+        return null;
     }
     
     
@@ -219,6 +225,5 @@
         }
         return commentWrapper;
     }
+    
 }
-
-



Mime
View raw message