We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 4ae7fc6 commit 2d21d28Copy full SHA for 2d21d28
1 file changed
client/src/cbltest/api/syncgateway.py
@@ -793,11 +793,14 @@ async def upsert_documents(
793
current_doc = await self.get_document(
794
db_name, update.id, scope, collection
795
)
796
- current_body = dict(current_doc.body)
797
- current_body.update(update.to_json())
798
- current_body["_id"] = update.id
799
- if update.rev:
800
- current_body["_rev"] = update.rev
+ if current_doc is not None:
+ current_body = dict(current_doc.body)
+ current_body.update(update.to_json())
+ current_body["_id"] = update.id
+ if update.rev:
801
+ current_body["_rev"] = update.rev
802
+ else:
803
+ current_body = update.to_json()
804
except Exception:
805
current_body = update.to_json()
806
merged_updates.append(
0 commit comments