Skip to content

How can I fix Timestamp.toDate() returning "undefined is not an object" even when I explicitly define to only check for that value if the Timestamp isn't null? #6032

Answered by andersonaddo
faz919 asked this question in Q&A
Discussion options

You must be logged in to vote

However, on app start, there is no selectedImage value and therefore the time and time.toDate() values are null

If what you're saying is true, selectedImage is undefined and time and time.toDate() would be erroneous
null and undefined are very different.

However, your error says something else. It's complaining that time is undefined, not selectedImage. It looks like you're not properly understanding the data flow of your app.

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by andersonaddo
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants