Skip to content

Commit

Permalink
spline #1116 TypeError: Cannot read property 'curVal' of null
Browse files Browse the repository at this point in the history
  • Loading branch information
wajda committed Oct 20, 2022
1 parent 77ee03f commit 69cdf83
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion arangodb-foxx-services/src/main/services/store.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,9 @@ function insertMany<T extends Record<string, any>>(docs: T[], colName: Collectio

function getDocByKey<T extends Document>(colName: CollectionName, key: DocumentKey, rtxInfo: ReadTxInfo = undefined): T {
const doc = <T & TxAwareDocument>db._document(`${colName}/${key}`)
return doc && rtxInfo && isVisibleFromTx(rtxInfo, doc) ? doc : null
return doc && rtxInfo && !isVisibleFromTx(rtxInfo, doc)
? null // the doc is found, but is not visible from inside the given read transaction.
: doc // otherwise return the doc, or null if it's not there.
}

function deleteByKey(colName: CollectionName, key: DocumentKey): DocumentMetadata {
Expand Down

0 comments on commit 69cdf83

Please sign in to comment.