summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/webchannel/qwebchannel.js10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/webchannel/qwebchannel.js b/src/webchannel/qwebchannel.js
index 0fae276..2df8704 100644
--- a/src/webchannel/qwebchannel.js
+++ b/src/webchannel/qwebchannel.js
@@ -200,7 +200,8 @@ function QObject(name, data, webChannel)
function unwrapQObject( response )
{
- if (!response["__QObject*__"]
+ if (!response
+ || !response["__QObject*__"]
|| response["id"] === undefined
|| response["data"] === undefined) {
return response;
@@ -329,8 +330,11 @@ function QObject(name, data, webChannel)
"method": methodIdx,
"args": args
}, function(response) {
- if ( (response !== undefined) && callback ) {
- (callback)(unwrapQObject(response));
+ if (response !== undefined) {
+ var result = unwrapQObject(response);
+ if (callback) {
+ (callback)(result);
+ }
}
});
};