plugins.version: Detect errors based on type attribute, rather than presence of query element

Thu, 29 Apr 2010 22:08:14 +0100

author
Matthew Wild <mwild1@gmail.com>
date
Thu, 29 Apr 2010 22:08:14 +0100
changeset 51
d044a726fef0
parent 50
432ac110544f
child 52
8416508bfeb4

plugins.version: Detect errors based on type attribute, rather than presence of query element

plugins/version.lua file | annotate | diff | comparison | revisions
--- a/plugins/version.lua	Fri Apr 02 16:07:43 2010 +0100
+++ b/plugins/version.lua	Thu Apr 29 22:08:14 2010 +0100
@@ -30,7 +30,7 @@
 			:tag("query", { xmlns = xmlns_version }), 
 			function (reply)
 				local query = reply:get_child("query", xmlns_version);
-				if query then
+				if reply.attr.type == "result" then
 					local name = query:get_child("name");
 					local version = query:get_child("version");
 					local os = query:get_child("os");

mercurial