prof18 / RSS-Parser

A Kotlin Multiplatform library to parse a RSS Feed
Apache License 2.0
502 stars 127 forks source link

Unterminated entity ref Exception #9

Closed luivit closed 6 years ago

luivit commented 6 years ago

Hi, i have a problem with your library. If in the rss page there is "&" char (not &amp) an exception is raised. For example trythis link http://insubs.com/rss "onError()" isn't called, but even if there is an Exception, library tell me "RSS Parser: RSS parsed correctly!"

W/System.err: org.xmlpull.v1.XmlPullParserException: unterminated entity ref (position:TEXT @1:195 in java.io.StringReader@93bd24d) W/System.err: at org.kxml2.io.KXmlParser.readEntity(KXmlParser.java:1219) W/System.err: at org.kxml2.io.KXmlParser.readValue(KXmlParser.java:1401) W/System.err: at org.kxml2.io.KXmlParser.next(KXmlParser.java:393) W/System.err: at org.kxml2.io.KXmlParser.next(KXmlParser.java:313) W/System.err: at org.kxml2.io.KXmlParser.nextText(KXmlParser.java:2075) W/System.err: at com.prof.rssparser.XMLParser.parseXML(XMLParser.java:66) W/System.err: at com.prof.rssparser.Parser.onPostExecute(Parser.java:79) W/System.err: at com.prof.rssparser.Parser.onPostExecute(Parser.java:34) W/System.err: at android.os.AsyncTask.finish(AsyncTask.java:651) W/System.err: at android.os.AsyncTask.-wrap1(AsyncTask.java) W/System.err: at android.os.AsyncTask$InternalHandler.handleMessage(AsyncTask.java:668) W/System.err: at android.os.Handler.dispatchMessage(Handler.java:102) W/System.err: at android.os.Looper.loop(Looper.java:148) W/System.err: at android.app.ActivityThread.main(ActivityThread.java:5417) W/System.err: at java.lang.reflect.Method.invoke(Native Method) W/System.err: at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726) W/System.err: at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616) I/RSS Parser: RSS parsed correctly!

prof18 commented 6 years ago

Oh, thanks for the reporting. I'll check it ASAP

prof18 commented 6 years ago

Ok, I found the problem. Inside the parser i was catching the exceptions rather than throwing them! I'll release an update soon.