Details
-
Bug
-
Resolution: Fixed
-
Major
-
1.4.1
-
None
-
NPE BaseObject XML
-
Description
toXML() (which is called by toString()) on a BaseObject may throw a "java.lang.IllegalArgumentException: Adding text to an XML document must not be null" if it is not yet linked to a document and its name has not been set.
This may be annoying since, for example, current release of Groovy may calls toString() when it prepare the message of exceptions about an object. This cause a double exception, that is not properly chained, and hide the initial cause. Moreover, it is almost impossible to catch the real cause in groovy. Triggering this situation could be done in groovy by creating an object from BaseClass.newObject() and then calling an unexistant method on it.
Attachments
Issue Links
- depends on
-
XWIKI-2813 Name of object should always be set to the name of their document
- Closed