From 32bae511770f15377011aa7b1f151e61d3dca54a Mon Sep 17 00:00:00 2001 From: Andrzej Popowski Date: Thu, 17 Sep 2015 14:29:47 +0200 Subject: [PATCH] [Filesystem] - Fixing a bug in the tizen.file.readAsText function Change-Id: I3aef0ac9f0c709ba25ccd841458d96d27b9a89c6 Signed-off-by: Andrzej Popowski --- src/filesystem/js/file.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/filesystem/js/file.js b/src/filesystem/js/file.js index dc68afbc..6bcbe42d 100755 --- a/src/filesystem/js/file.js +++ b/src/filesystem/js/file.js @@ -320,6 +320,7 @@ File.prototype.readAsText = function(onsuccess, onerror, encoding) { do { result = native_.callSyncData('File_readSync', data); + if (native_.isFailure(result)) { setTimeout(function() { native_.callIfPossible(args.onerror, native_.getErrorObject(result)); @@ -327,8 +328,8 @@ File.prototype.readAsText = function(onsuccess, onerror, encoding) { return; } str += result.output; - data.offset += result.data_size; - } while (result.data_size); + data.offset += result.reply.data_size; + } while (result.reply.data_size); setTimeout(function() { native_.callIfPossible(args.onsuccess, str); -- 2.34.1