To protect yourself from this, you can use Object.assign() to always return an object to the client:How to write beautiful Node.js APIs using async/await and the Firebase Database2.2K12Paul BreslinModest MachnickiFollowJul 23, 2017 · 1 min readSimpler way:res.send(snapshot.val() || {});