ahsankhatri / firestore-php

Firestore PHP Client (without gRPC extension)
MIT License
62 stars 57 forks source link

Fix crash when trying to read empty array #4

Closed p-blomberg closed 5 years ago

p-blomberg commented 5 years ago

When you have an empty array in your Firestore, and you try to read that with firestore-php, your will encounter an undefined index error. This pull request fixes this by checking if the array is empty, and if so, returns the empty array instead of trying to iterate over it.