Handle bad page names gracefully
This commit is contained in:
parent
dad49db729
commit
adb035bbc3
5
wp2git.d
5
wp2git.d
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue