[Yanel-commits] rev 37397 -
public/yanel/trunk/src/resources/file/src/java/org/wyona/yanel/impl/resources/node
michi at wyona.com
michi at wyona.com
Fri Jul 4 16:32:21 CEST 2008
Author: michi
Date: 2008-07-04 16:32:20 +0200 (Fri, 04 Jul 2008)
New Revision: 37397
Modified:
public/yanel/trunk/src/resources/file/src/java/org/wyona/yanel/impl/resources/node/NodeResource.java
Log:
check if revisions are null
Modified: public/yanel/trunk/src/resources/file/src/java/org/wyona/yanel/impl/resources/node/NodeResource.java
===================================================================
--- public/yanel/trunk/src/resources/file/src/java/org/wyona/yanel/impl/resources/node/NodeResource.java 2008-07-04 14:26:57 UTC (rev 37396)
+++ public/yanel/trunk/src/resources/file/src/java/org/wyona/yanel/impl/resources/node/NodeResource.java 2008-07-04 14:32:20 UTC (rev 37397)
@@ -194,15 +194,20 @@
public RevisionInformation[] getRevisions() throws Exception {
Revision[] revisions = getNode().getRevisions();
- RevisionInformation[] revisionInfos = new RevisionInformation[revisions.length];
+ if (revisions != null) {
+ RevisionInformation[] revisionInfos = new RevisionInformation[revisions.length];
- for (int i = 0; i < revisions.length; i++) {
- revisionInfos[i] = new RevisionInformation(revisions[i]);
+ for (int i = 0; i < revisions.length; i++) {
+ revisionInfos[i] = new RevisionInformation(revisions[i]);
+ }
+ if (revisions.length > 0) {
+ log.warn("Node \"" + getPath() + "\" does not seem to have any revisions! The repository \"" + getRealm().getRepository() + "\" might not support revisions!");
+ }
+ return revisionInfos;
+ } else {
+ log.warn("Node '" + getNode().getPath() + "' has no revisions!");
+ return null;
}
- if (revisions.length > 0) {
- log.warn("Node \"" + getPath() + "\" does not seem to have any revisions! The repository \"" + getRealm().getRepository() + "\" might not support revisions!");
- }
- return revisionInfos;
}
public void checkin(String comment) throws Exception {
More information about the Yanel-commits
mailing list