Ticket #1772: RDF.js.patch

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

patch with exception handling

  • RDF.js

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