Handle bad page names gracefully

This commit is contained in:
Vladimir Panteleev 2010-09-13 01:25:01 +03:00
parent dad49db729
commit adb035bbc3
1 changed files with 4 additions and 1 deletions

View File

@ -51,7 +51,10 @@ int main(string[] args)
auto xml = new XmlDocument(new MemoryStream(xmldata));
string data = "reset refs/heads/master\n";
foreach (child; xml[0]["page"])
auto page = xml[0]["page"];
if (!page)
throw new Exception("No such page");
foreach (child; page)
if (child.tag=="revision")
{
string id = child["id"].text;