diff options
Diffstat (limited to 'web/react/utils')
-rw-r--r-- | web/react/utils/utils.jsx | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/web/react/utils/utils.jsx b/web/react/utils/utils.jsx index 00580af6e..fbf1e0d4f 100644 --- a/web/react/utils/utils.jsx +++ b/web/react/utils/utils.jsx @@ -546,10 +546,13 @@ module.exports.getIconClassName = function(fileType) { module.exports.splitFileLocation = function(fileLocation) { var fileSplit = fileLocation.split('.'); - if (fileSplit.length < 2) return {}; - var ext = fileSplit[fileSplit.length-1]; - fileSplit.splice(fileSplit.length-1,1) + var ext = ""; + if (fileSplit.length > 1) { + ext = fileSplit[fileSplit.length - 1]; + fileSplit.splice(fileSplit.length - 1, 1); + } + var filePath = fileSplit.join('.'); var filename = filePath.split('/')[filePath.split('/').length-1]; |