[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    KDE/kdeedu/marble/src/lib/geodata/parser
From:       Andrew Manson <g.real.ate () gmail ! com>
Date:       2009-07-20 10:27:32
Message-ID: 1248085652.573964.14453.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 999651 by mansona:

Bug:181976 fixed
Deals with bad XML files by producing a warning instead of a crash. 


 M  +7 -2      GeoParser.cpp  


--- trunk/KDE/kdeedu/marble/src/lib/geodata/parser/GeoParser.cpp #999650:999651
@@ -96,7 +96,7 @@
                 if ( !m_nodeStack.isEmpty() )
                     raiseError(
                         QObject::tr("Parsing failed. Still %n unclosed tag(s) after document end.", "",
-                        m_nodeStack.size() ));
+                        m_nodeStack.size() ) + errorString());
             } else
                 raiseDocumentElementError();
         }
@@ -125,7 +125,12 @@
 
 void GeoParser::parseDocument()
 {
-    Q_ASSERT( isStartElement() );
+    if( !isStartElement() ) {
+        raiseError( QString("Error parsing file at line: %1 and column %2 . ")
+                    .arg( lineNumber() ).arg( columnNumber() )
+                    +  QString("This is an Invalid File") );
+        return;
+    }
 
     while ( !atEnd() ) {
         readNext();
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic