unnecessary property check

v1.18.x
psychobunny 12 years ago
parent be21e11b69
commit 533659e2fd

@ -185,25 +185,23 @@ var fs = require('fs'),
} }
function mapStaticDirs(mappedPath) { function mapStaticDirs(mappedPath) {
if (pluginData.staticDirs.hasOwnProperty(mappedPath)) { if (Plugins.staticDirs[mappedPath]) {
if (Plugins.staticDirs[mappedPath]) { winston.warn('[plugins/' + pluginData.id + '] Mapped path (' + mappedPath + ') already specified!');
winston.warn('[plugins/' + pluginData.id + '] Mapped path (' + mappedPath + ') already specified!'); } else if (!validMappedPath.test(mappedPath)) {
} else if (!validMappedPath.test(mappedPath)) { winston.warn('[plugins/' + pluginData.id + '] Invalid mapped path specified: ' + mappedPath + '. Path must adhere to: ' + validMappedPath.toString());
winston.warn('[plugins/' + pluginData.id + '] Invalid mapped path specified: ' + mappedPath + '. Path must adhere to: ' + validMappedPath.toString()); } else {
} else { realPath = pluginData.staticDirs[mappedPath];
realPath = pluginData.staticDirs[mappedPath]; staticDir = path.join(pluginPath, realPath);
staticDir = path.join(pluginPath, realPath);
(function(staticDir) { (function(staticDir) {
fs.exists(staticDir, function(exists) { fs.exists(staticDir, function(exists) {
if (exists) { if (exists) {
Plugins.staticDirs[pluginData.id + '/' + mappedPath] = staticDir; Plugins.staticDirs[pluginData.id + '/' + mappedPath] = staticDir;
} else { } else {
winston.warn('[plugins/' + pluginData.id + '] Mapped path \'' + mappedPath + ' => ' + staticDir + '\' not found.'); winston.warn('[plugins/' + pluginData.id + '] Mapped path \'' + mappedPath + ' => ' + staticDir + '\' not found.');
} }
}); });
}(staticDir)); }(staticDir));
}
} }
} }

Loading…
Cancel
Save