Fix progress queue segfault (#3359)
This commit is contained in:
parent
8125b62108
commit
8f4cb5002a
1 changed files with 8 additions and 0 deletions
|
@ -68,6 +68,14 @@ const ProgressQueueTable = ({ onActivate = noop, progressQueue }) => {
|
|||
for (let column of columns) {
|
||||
if (column.dataKey === 'success') {
|
||||
let span = document.createElement('span');
|
||||
if (!span.ownerGlobal) {
|
||||
// If this script was imported from a non-window context, we'll have a global object that looks like
|
||||
// a Window and document.createElement() will succeed, but the returned Element object won't have
|
||||
// an ownerGlobal. Trying to append a child or set its innerHTML will segfault Zotero. For now,
|
||||
// let's just abort if we get an invalid Element.
|
||||
// TODO: Remove once we're using ES modules
|
||||
return div;
|
||||
}
|
||||
span.className = `cell icon ${column.className}`;
|
||||
span.appendChild(getImageByStatus(row.status));
|
||||
div.appendChild(span);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue