Skip to content

Commit

Permalink
fix(quoteCombine): resolve undefined for missing symbols (#150)
Browse files Browse the repository at this point in the history
  • Loading branch information
gadicc committed Apr 28, 2021
1 parent bebb7d6 commit f8c25e3
Showing 1 changed file with 15 additions and 2 deletions.
17 changes: 15 additions & 2 deletions src/other/quoteCombine.ts
Original file line number Diff line number Diff line change
Expand Up @@ -84,9 +84,22 @@ export default function quoteCombine(
// @ts-ignore
thisQuote(symbols, queryOptionsOverrides, moduleOptions)
.then((results) => {
for (let result of results)
for (let promise of entry.symbols.get(result.symbol))
for (let result of results) {
for (let promise of entry.symbols.get(result.symbol)) {
promise.resolve(result);
promise.resolved = true;
}
}

// Check for symbols we asked for and didn't get back,
// e.g. non-existant symbols (#150)
for (let [symbol, promises] of entry.symbols) {
for (let promise of promises) {
if (!promise.resolved) {
promise.resolve(undefined);
}
}
}
})
.catch((error) => {
for (let symbolPromiseCallbacks of entry.symbols.values())
Expand Down

0 comments on commit f8c25e3

Please sign in to comment.