Fix potential crash activating integration dialog on Linux

This commit is contained in:
Simon Kornblith 2012-02-02 03:07:26 -05:00
parent c98570ca4b
commit 5b8b515b06

View file

@ -564,8 +564,9 @@ Zotero.Integration = new function() {
var children = ctypes.cast(childrenPtr, ctypes.uint32_t.array(nChildrenJS).ptr).contents;
var foundWindow = false;
for(var i=0; i<nChildrenJS; i++) {
foundWindow = _X11FindWindow(display, children.addressOfElement(i).contents,
searchName);
var testWin = children.addressOfElement(i).contents;
if(testWin == 0) continue;
foundWindow = _X11FindWindow(display, testWin, searchName);
if(foundWindow) break;
}
@ -2997,4 +2998,4 @@ Zotero.Integration.URIMap.prototype.getZoteroItemForURIs = function(uris) {
}
return [zoteroItem, needUpdate];
}
}