fix handling of files without extensions
This commit is contained in:
parent
a7a911683c
commit
dd5942c538
|
@ -260,8 +260,9 @@ var Zotero_File_Interface = new function() {
|
||||||
function _importTranslatorsAvailable(translation, translators) {
|
function _importTranslatorsAvailable(translation, translators) {
|
||||||
if(translators.length) {
|
if(translators.length) {
|
||||||
if(translation.location instanceof Components.interfaces.nsIFile) {
|
if(translation.location instanceof Components.interfaces.nsIFile) {
|
||||||
var collectionName = (translation.location.isDirectory() ? translation.location.leafName
|
var leafName = translation.location.leafName;
|
||||||
: translation.location.leafName.substr(0, translation.location.leafName.lastIndexOf(".")));
|
var collectionName = (translation.location.isDirectory() || leafName.indexOf(".") === -1 ? leafName
|
||||||
|
: leafName.substr(0, leafName.lastIndexOf(".")));
|
||||||
var allCollections = Zotero.getCollections();
|
var allCollections = Zotero.getCollections();
|
||||||
for(var i=0; i<allCollections.length; i++) {
|
for(var i=0; i<allCollections.length; i++) {
|
||||||
if(allCollections[i].name == collectionName) {
|
if(allCollections[i].name == collectionName) {
|
||||||
|
|
Loading…
Reference in New Issue
Block a user