commit dd5942c538e40a7b16f87046f9b9c27cf08e94cc
parent a7a911683c6c5611146d9fcdc5b1666b9e482ce6
Author: Simon Kornblith <simon@simonster.com>
Date: Sun, 7 Nov 2010 07:38:50 +0000
fix handling of files without extensions
Diffstat:
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/chrome/content/zotero/fileInterface.js b/chrome/content/zotero/fileInterface.js
@@ -260,8 +260,9 @@ var Zotero_File_Interface = new function() {
function _importTranslatorsAvailable(translation, translators) {
if(translators.length) {
if(translation.location instanceof Components.interfaces.nsIFile) {
- var collectionName = (translation.location.isDirectory() ? translation.location.leafName
- : translation.location.leafName.substr(0, translation.location.leafName.lastIndexOf(".")));
+ var leafName = translation.location.leafName;
+ var collectionName = (translation.location.isDirectory() || leafName.indexOf(".") === -1 ? leafName
+ : leafName.substr(0, leafName.lastIndexOf(".")));
var allCollections = Zotero.getCollections();
for(var i=0; i<allCollections.length; i++) {
if(allCollections[i].name == collectionName) {
@@ -617,4 +618,4 @@ Zotero_File_Interface.Progress = new function() {
function close() {
Zotero.hideZoteroPaneOverlay();
}
-}
-\ No newline at end of file
+}