Author: psharples
Date: Tue Oct 11 17:57:29 2011
New Revision: 1181992

URL: http://svn.apache.org/viewvc?rev=1181992&view=rev
Log:
Fix to check that the doc type exists before carrying out an operation on it. 
See WOOKIE-259.

Modified:
    incubator/wookie/trunk/src/org/apache/wookie/util/html/HtmlCleaner.java

Modified: 
incubator/wookie/trunk/src/org/apache/wookie/util/html/HtmlCleaner.java
URL: 
http://svn.apache.org/viewvc/incubator/wookie/trunk/src/org/apache/wookie/util/html/HtmlCleaner.java?rev=1181992&r1=1181991&r2=1181992&view=diff
==============================================================================
--- incubator/wookie/trunk/src/org/apache/wookie/util/html/HtmlCleaner.java 
(original)
+++ incubator/wookie/trunk/src/org/apache/wookie/util/html/HtmlCleaner.java Tue 
Oct 11 17:57:29 2011
@@ -176,9 +176,11 @@ public class HtmlCleaner implements IHtm
         */
        private void fixHTML5Doctype(){
                DoctypeToken docType = htmlNode.getDocType();
-               
if(docType.getContent().equalsIgnoreCase(Html5DoctypeToken.BADDOCTYPE)){
-                       Html5DoctypeToken newToken = new 
Html5DoctypeToken("html",null,null,null);
-                       htmlNode.setDocType(newToken);
+               if(docType != null){
+                       
if(docType.getContent().equalsIgnoreCase(Html5DoctypeToken.BADDOCTYPE)){
+                               Html5DoctypeToken newToken = new 
Html5DoctypeToken("html",null,null,null);
+                               htmlNode.setDocType(newToken);
+                       }
                }
        }
 


Reply via email to