TypeError when inserting an object with null
prototype
#1196
Labels
api: bigquery
Issues related to the googleapis/nodejs-bigquery API.
priority: p2
Moderately-important priority. Fix may not be included in next release.
type: bug
Error or flaw in code with unintended results or allowing sub-optimal usage patterns.
Environment details
@google-cloud/bigquery
version: 6.1.0Steps to reproduce
Object.create(null)
new BigQuery().dataset('...').table('...').createInsertStream()
This causes a
TypeError: Cannot read properties of undefined (reading 'name')
This is cause by line 573 in table.ts, which reads:
For an object created with
Object.create(null)
, constructor isundefined
so this causes an error.Suggestion: Change this line to:
This should allow it to handle
null
constructor objects without changing anything for other types.The text was updated successfully, but these errors were encountered: