PRPage and empty contents

Dominique Dutoit dominiqued at versateladsl.be
Thu Mar 9 01:30:22 MET 2006


If the text area for the contents is left empty, PRPage>>contents:  
receives a nil object and fails to parse it as a document.

The reason is that the parser can only interpret string objects and  
not nil objects.

PRDocumentParser parse: nil.

The solution could be to assign an empty PRDocument if the value of  
aString is an nil object.

PRPage>>contents: aString
	aString
		ifNil: [ self document: PRDocument new ]
		ifNotNil: [ self document: (self parserClass parse: aString) ].


More information about the SmallWiki mailing list