From 33a6caef1505e2de5a5d21f1883c123874fd2aef Mon Sep 17 00:00:00 2001 From: Dan Stillman Date: Thu, 17 Mar 2011 20:16:10 +0000 Subject: [PATCH] Fix "val.indexOf is not a function" loading attachments with all-numeric titles --- chrome/content/zotero/bindings/attachmentbox.xml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/chrome/content/zotero/bindings/attachmentbox.xml b/chrome/content/zotero/bindings/attachmentbox.xml index ae01fca88a..f6bb003143 100644 --- a/chrome/content/zotero/bindings/attachmentbox.xml +++ b/chrome/content/zotero/bindings/attachmentbox.xml @@ -162,6 +162,10 @@ } var val = this.item.getField('title'); + if (typeof val != 'string') { + val += ""; + } + var firstSpace = val.indexOf(" "); // Crop long uninterrupted text if ((firstSpace == -1 && val.length > 29 ) || firstSpace > 29) {