Index: C:/Documents and Settings/gec/workspace/trunks-users/xwiki/core/src/main/java/com/xpn/xwiki/xmlrpc/PageSummary.java =================================================================== --- C:/Documents and Settings/gec/workspace/trunks-users/xwiki/core/src/main/java/com/xpn/xwiki/xmlrpc/PageSummary.java (revision 1953) +++ C:/Documents and Settings/gec/workspace/trunks-users/xwiki/core/src/main/java/com/xpn/xwiki/xmlrpc/PageSummary.java (working copy) @@ -51,7 +51,22 @@ this.setParentId((String)pageht.get("parentId")); this.setTitle((String)pageht.get("title")); this.setUrl((String)pageht.get("url")); - this.setLocks(((Integer)pageht.get("locks")).intValue()); + + /* + * Check if we want to update or to create a new page. If + * id is not null, we are updateing. + * + * For adding, the Page given as an argument should have space, + * title and content fields at a minimum. + * + * So if we want to create a new page, calls like + * ((Integer)pageht.get("locks")).intValue() + * will result in a NullPointerException, becaue + * pageht.get("locks") will return null. + */ + if (getId() != null) { + this.setLocks(((Integer)pageht.get("locks")).intValue()); + } } public PageSummary(XWikiDocument doc, XWikiContext context) {