Skip to content

Commit

Permalink
Fix null/empty doc issue
Browse files Browse the repository at this point in the history
  • Loading branch information
WolfgangSenff authored Jul 18, 2024
1 parent 78db57d commit 024ef50
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions addons/godot-firebase/firestore/firestore_document.gd
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,10 @@ func _init(doc : Dictionary = {}):

if doc.has("fields"):
document = doc.fields
doc_name = doc.name
if doc_name.count("/") > 2:
doc_name = (doc_name.split("/") as Array).back()
if doc.has("name"):
doc_name = doc.name
if doc_name.count("/") > 2:
doc_name = (doc_name.split("/") as Array).back()

self.create_time = doc.createTime

Expand Down

0 comments on commit 024ef50

Please sign in to comment.