[DataControl] Fix for addChangeListener 82/164682/1
authorLukasz Bardeli <l.bardeli@samsung.com>
Wed, 20 Dec 2017 09:29:43 +0000 (10:29 +0100)
committerLukasz Bardeli <l.bardeli@samsung.com>
Wed, 20 Dec 2017 09:29:43 +0000 (10:29 +0100)
[Verification] Code compiles without error. TCT passrate 100%

Change-Id: I6ad313b82498f1517d65f53d3cf5bdba600fe521
Signed-off-by: Lukasz Bardeli <l.bardeli@samsung.com>
src/datacontrol/datacontrol_api.js

index 24a78c6e71400cc972a5b0445b4c5f49c8ef2a69..5de955ec6ebd2b23b57633976c960f85876d105b 100755 (executable)
@@ -105,10 +105,11 @@ var DataControlListenersManager = (function() {
           dataId: dataId,
           type: type
         }, callback);
-      result = native_.getResultObject(result);
+
       if (native_.isFailure(result)) {
         throw native_.getErrorObject(result);
       } else {
+        result = native_.getResultObject(result);
         _realWatchId = converter_.toLong(result.watchId, true);
       }
       if (type_.isEmptyObject(this._SQLDataControlCbMap) &&