If no error callback is provided at introspection, continue to get properties on...
authorLuc Yriarte <luc.yriarte@intel.com>
Thu, 18 Oct 2012 12:43:08 +0000 (14:43 +0200)
committerLuc Yriarte <luc.yriarte@intel.com>
Fri, 16 Nov 2012 18:13:35 +0000 (19:13 +0100)
cloudeebus/cloudeebus.js

index f81e7e6..dd51823 100644 (file)
@@ -140,12 +140,16 @@ cloudeebus.ProxyObject.prototype._introspect = function(successCB, errorCB) {
        function getAllPropertiesSuccessCB(props) {
                for (var prop in props)
                        self[prop] = props[prop];
+               getAllPropertiesNextInterfaceCB();
+       }
+       
+       function getAllPropertiesNextInterfaceCB() {
                if (self.propInterfaces.length > 0) 
                        self.callMethod("org.freedesktop.DBus.Properties", 
                                "GetAll", 
                                [self.propInterfaces.pop()], 
                                getAllPropertiesSuccessCB, 
-                               errorCB);
+                               errorCB ? errorCB : getAllPropertiesNextInterfaceCB);
                else {
                        self.propInterfaces = null;
                        if (successCB)
@@ -192,7 +196,7 @@ cloudeebus.ProxyObject.prototype._introspect = function(successCB, errorCB) {
                                "GetAll", 
                                [self.propInterfaces.pop()], 
                                getAllPropertiesSuccessCB, 
-                               errorCB);
+                               errorCB ? errorCB : getAllPropertiesNextInterfaceCB);
                }
                else {
                        self.propInterfaces = null;