Details
-
Type:
Bug
-
Status:
Closed
-
Priority:
Minor
-
Resolution: Fixed
-
Affects Version/s: 2.0
-
Fix Version/s: 2.1 M1
-
Component/s: {Unused} Core
-
Labels:None
-
keywords:patch
-
Difficulty:Trivial
-
Similar issues:
XWIKI-6593Deleting documents with attachments that have no versioning returning NullPointerException XWIKI-2052XWikiDocument.equals always returns false if a document is compared to itself XWIKI-1916NullPointerException in the public RSS feed generated when there are some private documents XWIKI-2799LDAP NullPointerException when user profile page already exist but does not contains user object XWIKI-3692Conversion should protect from phantom objects XWIKI-4265Invocation of com.xpn.xwiki.doc.XWikiDocument#getPreviousVersion produce a NullPointerException XWIKI-2051Can't get properties values from a document's api Object from another wiki XWIKI-2544LDAP User synchronisation sometimes failed when the User document contains a Tag object XWIKI-2842When loading documents from a different wiki, objects are loaded with the wrong class XWIKI-1906SoftReference for XWikiDocumentArchive improperly used
Description
While cycling through all documents in XE and looking for differences between my loader and the default, I found an error from documents which have missing places in the set of objects. XWikiDocument.equals checks to see if the other document has null objects, but doesn't check to see if "this" document has null objects before calling equals on the objects. This can cause a NullPointerException.
If this document's object is null and that document's object is not null, return false.
If that document's object is null and this document's object isn't, return false.
if both objects are null, continue; don't try to compare null objects.