From d6616c8b761f662618ad57b8e5e2bf7b726d028f Mon Sep 17 00:00:00 2001 From: coderaiser Date: Tue, 24 Jan 2017 12:24:20 +0200 Subject: [PATCH] chore(dom) getCurrentData: add early return --- client/dom.js | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/client/dom.js b/client/dom.js index c8d5971b..11c905b0 100644 --- a/client/dom.js +++ b/client/dom.js @@ -739,24 +739,24 @@ var CloudCmd, Util, DOM, CloudFunc; if (Info.name === '..') { Dialog.alert.noFiles(TITLE); - callback(Error('No files selected!')); - } else if (isDir) { - RESTful.read(path, func); - } else { - DOM.checkStorageHash(path, function(error, equal, hashNew) { - if (error) { - callback(error); - } else if (equal) { - DOM.getDataFromStorage(path, callback); - } else { - hash = hashNew; - RESTful.read(path, func); - } - }); + return callback(Error('No files selected!')); } + + if (isDir) + return RESTful.read(path, func); + + DOM.checkStorageHash(path, function(error, equal, hashNew) { + if (error) { + callback(error); + } else if (equal) { + DOM.getDataFromStorage(path, callback); + } else { + hash = hashNew; + RESTful.read(path, func); + } + }); }; - /** * unified way to save current file content *