sainsburys-tech / next-logger

JSON logging patcher for Next.js
MIT License
144 stars 14 forks source link

Handle undefined and null values #5

Closed timoweiss closed 2 years ago

timoweiss commented 2 years ago

Hello,

I noticed that if the log is either null or undefined, the obj.length === 1 check fails :)

Not sure if this is the desired place to check for that? I would also be reasonable to check for that before calling getMessage.

jakemhiller commented 2 years ago

Seeing the same issue, I think there's an incompatible log in the latest Next.JS version, so this is actually a pretty big problem.

atkinchris commented 2 years ago

Will get this sorted this afternoon!

atkinchris commented 2 years ago

This is published in v2.1.1. Thanks @timoweiss!

timoweiss commented 2 years ago

Thank you @atkinchris ! sorry for the linting/formatting issues