Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

functions.logger throws an exception when attempting to log null #716

Closed
arthurM2x opened this issue Jun 24, 2020 · 2 comments
Closed

functions.logger throws an exception when attempting to log null #716

arthurM2x opened this issue Jun 24, 2020 · 2 comments

Comments

@arthurM2x
Copy link

arthurM2x commented Jun 24, 2020

[REQUIRED] Version info

**node:**10

**firebase-functions:**3.7.0

**firebase-tools:**8.4.3

**firebase-admin:**8.10.0

[REQUIRED] Test case

import * as functions from 'firebase-functions'

// throws an exception
functions.logger.log('something', null)

[REQUIRED] Steps to reproduce

attempt to log null

[REQUIRED] Expected behavior

no exception

[REQUIRED] Actual behavior

exception thrown:

TypeError: Cannot read property 'constructor' of null
at entryFromArgs (/workspace/node_modules/firebase-functions/lib/logger.js:78:47)
at Object.log (/workspace/node_modules/firebase-functions/lib/logger.js:45:11)

https://github.com/firebase/firebase-functions/blob/master/src/logger.ts#L107
src/logger.ts:107
if (typeof lastArg == 'object' && lastArg.constructor == Object) {

typeof null -> "object"
so would be beneficial to add a null check there

Were you able to successfully deploy your functions?

Yes

@google-oss-bot
Copy link
Collaborator

I found a few problems with this issue:

  • I couldn't figure out how to label this issue, so I've labeled it for a human to triage. Hang tight.
  • This issue does not seem to follow the issue template. Make sure you provide all the required information.

@rhodgkins
Copy link
Contributor

Any ideas on when this is going to get released?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants