From cc726ef333ed4a4129d96371dee4e39154b0c1d1 Mon Sep 17 00:00:00 2001 From: Dan Stillman Date: Tue, 12 Sep 2006 05:20:43 +0000 Subject: [PATCH] Not that it should happen, but survive an item with an item type of 0 or undefined (and more importantly, let you delete or change it) --- chrome/chromeFiles/content/scholar/xpcom/data_access.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/chrome/chromeFiles/content/scholar/xpcom/data_access.js b/chrome/chromeFiles/content/scholar/xpcom/data_access.js index 74b2b931a..5fe955c50 100644 --- a/chrome/chromeFiles/content/scholar/xpcom/data_access.js +++ b/chrome/chromeFiles/content/scholar/xpcom/data_access.js @@ -3331,6 +3331,12 @@ Scholar.ItemFields = new function(){ return _itemTypeFields[itemTypeID]; } + if (!itemTypeID){ + Scholar.debug("Invalid item type id '" + itemTypeID + + "' provided to getItemTypeFields()", 1); + return []; + } + var sql = 'SELECT fieldID FROM itemTypeFields ' + 'WHERE itemTypeID=' + itemTypeID + ' ORDER BY orderIndex';