Don't throw in Zotero.DataObjects::get() for nonexistent objects
Return false for single ids or skip for multiple ids. This is the original behavior, but at some point it started throwing an UnloadedDataException. IDs are always loaded at initialization, though, so we know whether the objects actually exist.
This commit is contained in:
parent
bf3ad6a2a4
commit
ab4138cf26
2 changed files with 16 additions and 1 deletions
|
@ -3,6 +3,12 @@
|
|||
describe("Zotero.DataObjects", function () {
|
||||
var types = ['collection', 'item', 'search'];
|
||||
|
||||
describe("#get()", function () {
|
||||
it("should return false for nonexistent objects", function* () {
|
||||
assert.isFalse(Zotero.Items.get(3464363));
|
||||
});
|
||||
});
|
||||
|
||||
describe("#getLibraryAndKeyFromID()", function () {
|
||||
it("should return a libraryID and key within a transaction", function* () {
|
||||
for (let type of types) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue