Index: src/main/java/com/xpn/xwiki/doc/XWikiDocument.java =================================================================== --- src/main/java/com/xpn/xwiki/doc/XWikiDocument.java (revision 23606) +++ src/main/java/com/xpn/xwiki/doc/XWikiDocument.java (working copy) @@ -4112,10 +4112,13 @@ for (Vector objects : objectclasses.values()) { if (objects != null) { for (BaseObject object : objects) { - object.setName(newDocumentName); - // Since GUIDs are supposed to be Unique, although this object holds the same data, it is not - // exactly the same object, so it should have a different identifier. - object.setGuid(UUID.randomUUID().toString()); + if (object != null) { + object.setName(newDocumentName); + // Since GUIDs are supposed to be Unique, although this object holds the same data, it is + // not + // exactly the same object, so it should have a different identifier. + object.setGuid(UUID.randomUUID().toString()); + } } } }