diff --git a/lib/util.js b/lib/util.js index 5e6dc534..01e3146e 100644 --- a/lib/util.js +++ b/lib/util.js @@ -870,12 +870,15 @@ * @return Ext */ this.getExtension = function(name) { - var ret, dot, - isStr = Util.isString(name); + var ret = '', + dot, + isStr = Util.isString(name); if (isStr) { dot = name.lastIndexOf('.'); - ret = name.substr(dot); + + if (~dot) + ret = name.substr(dot); } return ret;