Fix some display string that contained an unused %s and an NPE

This makes the android app crash when the XML cannot be validated.
This commit is contained in:
Xavier Ducrohet
2009-08-06 19:25:27 -07:00
parent 097ba88d53
commit 5ae5e3da1b

View File

@@ -185,7 +185,7 @@ public class RepoSource implements IDescription {
monitor.setDescription("Parse XML"); monitor.setDescription("Parse XML");
monitor.incProgress(1); monitor.incProgress(1);
parsePackages(xml, monitor); parsePackages(xml, monitor);
if (mPackages.length == 0) { if (mPackages == null || mPackages.length == 0) {
mDescription += "\nNo packages found."; mDescription += "\nNo packages found.";
} else if (mPackages.length == 1) { } else if (mPackages.length == 1) {
mDescription += "\nOne package found."; mDescription += "\nOne package found.";
@@ -370,10 +370,10 @@ public class RepoSource implements IDescription {
} }
} catch (ParserConfigurationException e) { } catch (ParserConfigurationException e) {
monitor.setResult("Failed to create XML document builder for %1$s"); monitor.setResult("Failed to create XML document builder");
} catch (SAXException e) { } catch (SAXException e) {
monitor.setResult("Failed to parse XML document %1$s"); monitor.setResult("Failed to parse XML document");
} catch (IOException e) { } catch (IOException e) {
monitor.setResult("Failed to read XML document"); monitor.setResult("Failed to read XML document");