Ticket #1772: RDF.js.2.patch

File RDF.js.2.patch, 923 bytes (added by ajlyon, 6 years ago)

Yet another patch. Now with debug logging and no extraneous logic.

  • RDF.js

     
    6868                return; 
    6969        } 
    7070         
    71         if(typeof(creators[0]) != "string") {   // see if creators are in a container 
     71        if(typeof(creators[0]) != "string") { 
     72                // see if creators are in a container, but if they don't seem to be, 
     73                // then we don't attempt to extract them. 
    7274                try { 
    73                         var creators = Zotero.RDF.getContainerElements(creators[0]); 
    74                 } catch(e) {} 
     75                        var newCreators = Zotero.RDF.getContainerElements(creators[0]); 
     76                } catch (e) { 
     77                        Zotero.debug("Exception caught in Zotero.RDF.getContainerElements"); 
     78                } 
     79                if (creators.length === newCreators.length) { 
     80                        creators = newCreators; 
     81                } 
    7582        } 
    7683         
    7784        if(typeof(creators[0]) == "string") {   // support creators encoded as strings 
     
    629636                        newCollection.complete(); 
    630637                } 
    631638        } 
    632 } 
    633  No newline at end of file 
     639}