Skip to content

Commit 792c3a3

Browse files
committed
Fixes #23
1 parent 312594e commit 792c3a3

File tree

3 files changed

+10
-10
lines changed

3 files changed

+10
-10
lines changed

src/PathwaySearch.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -442,9 +442,9 @@ PathwaySearch.prototype.parseByCompoundResponse = function(response) {
442442
parts = item.hasPart;
443443
about = parts[constants.ABOUT];
444444
type = parts.type;
445-
geneProductLabel = parts.exactMatch.prefLabel;
445+
geneProductLabel = parts.exactMatch != null ? parts.exactMatch.prefLabel : null;
446446
geneProductURI = parts[constants.ABOUT];
447-
geneProductCWURI = parts.exactMatch[constants.ABOUT];
447+
geneProductCWURI = parts.exactMatch != null ? parts.exactMatch[constants.ABOUT] : null;
448448
organism = item.pathway_organism[constants.ABOUT];
449449
organismLabel = item.pathway_organism.label;
450450
description = item.description ? item.description : null;

src/combined.js

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1933,11 +1933,10 @@ function createXHR(options, callback) {
19331933
// IE must die
19341934
}
19351935
xhr.ontimeout = errorFunc
1936-
xhr.open(method, uri, !sync, options.username, options.password)
1936+
xhr.open(method, uri, !sync)
19371937
//has to be after open
1938-
if(!sync) {
1939-
xhr.withCredentials = !!options.withCredentials
1940-
}
1938+
xhr.withCredentials = !!options.withCredentials
1939+
19411940
// Cannot set timeout with sync request
19421941
// not setting timeout on the xhr object, because of old webkits etc. not handling that correctly
19431942
// both npm's request and jquery 1.x use this kind of timeout, so this is being consistent
@@ -5265,9 +5264,9 @@ PathwaySearch.prototype.parseByCompoundResponse = function(response) {
52655264
parts = item.hasPart;
52665265
about = parts[constants.ABOUT];
52675266
type = parts.type;
5268-
geneProductLabel = parts.exactMatch.prefLabel;
5267+
geneProductLabel = parts.exactMatch != null ? parts.exactMatch.prefLabel : null;
52695268
geneProductURI = parts[constants.ABOUT];
5270-
geneProductCWURI = parts.exactMatch[constants.ABOUT];
5269+
geneProductCWURI = parts.exactMatch != null ? parts.exactMatch[constants.ABOUT] : null;
52715270
organism = item.pathway_organism[constants.ABOUT];
52725271
organismLabel = item.pathway_organism.label;
52735272
description = item.description ? item.description : null;

test/spec/integration/PathwayIntegrationSpec.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -90,14 +90,15 @@ describe("Pathways", function() {
9090
expect(pathway_result.geneProductLabel).toBeDefined();
9191
expect(pathway_result.geneProductURI).toBeDefined();
9292
expect(pathway_result.geneProductCWURI).toBeDefined();
93+
9394
//mandatory
9495
expect(pathway_result.title).not.toBeNull();
9596
expect(pathway_result.organism).not.toBeNull();
9697
expect(pathway_result.organismLabel).not.toBeNull();
9798
expect(pathway_result.identifier).not.toBeNull();
98-
expect(pathway_result.geneProductLabel).not.toBeNull();
99+
//expect(pathway_result.geneProductLabel).not.toBeNull();
99100
expect(pathway_result.geneProductURI).not.toBeNull();
100-
expect(pathway_result.geneProductCWURI).not.toBeNull();
101+
//expect(pathway_result.geneProductCWURI).not.toBeNull();
101102
});
102103
searcher.byCompound('http://www.conceptwiki.org/concept/83931753-9e3f-4e90-b104-e3bcd0b4d833', null, null, null, null, null, callback);
103104
});

0 commit comments

Comments
 (0)