Skip to content
This repository was archived by the owner on Apr 7, 2021. It is now read-only.
This repository was archived by the owner on Apr 7, 2021. It is now read-only.

Cannot read property 'name' of null #83

@teckays

Description

@teckays

This code:

client.login({ username: 'username', clientUid, password: 'asd' }, (success, data) => {
	const query = JSON.stringify({
		table: 'table',
		query: [ 
			[ 'createdBy', 'eq',  'username' ]
		]
	})
	const result = client.record.getList( 'search?' + query )
	result.whenReady(async r => {
		const ids = r.getEntries()
		let projects = await Promise.all(ids.map(async (id) => this.get(id)))
		result.delete()
	})
})

throws this error:

21:06:56:691 | received subscription for search?{"table":"table","query":[["createdBy","eq","username"]]}
LOCAL_LISTEN | nothing to stop for R:search?{"table":"table","query":[["createdBy","eq","username"]]}
RECORD_DELETION | search?{"table":"table","query":[["createdBy","eq","username"]]}
21:06:56:708 | discard subscription for search?{"table":"table","query":[["createdBy","eq","username"]]}
21:06:56:709 | Removing search search?{"table":"table","query":[["createdBy","eq","username"]]}
search?{"table":"table","query":[["createdBy","eq","username"]]}
/Users/.../node_modules/bluebird/js/main/async.js:43
        fn = function () { throw arg; };
                           ^

TypeError: Cannot read property 'name' of null
    at Search._processInitialValues (/Users/.../node_modules/deepstream.io-provider-search-rethinkdb/src/search.js:144:66)
    at Search._readChange (/Users/.../node_modules/deepstream.io-provider-search-rethinkdb/src/search.js:103:12)
    at /Users/.../node_modules/rethinkdb/cursor.js:261:20
    at tryCatcher (/Users/.../node_modules/bluebird/js/main/util.js:26:23)
    at Promise.successAdapter (/Users/.../node_modules/bluebird/js/main/nodeify.js:23:30)
    at Promise._settlePromiseAt (/Users/.../node_modules/bluebird/js/main/promise.js:582:21)
    at Promise._settlePromiseAtPostResolution (/Users/.../node_modules/bluebird/js/main/promise.js:248:10)
    at Async._drainQueue (/Users/.../node_modules/bluebird/js/main/async.js:128:12)
    at Async._drainQueues (/Users/.../node_modules/bluebird/js/main/async.js:133:10)
    at Immediate.Async.drainQueues [as _onImmediate] (/Users/.../node_modules/bluebird/js/main/async.js:15:14)
    at runCallback (timers.js:785:20)
    at tryOnImmediate (timers.js:747:5)
    at processImmediate [as _immediateCallback] (timers.js:718:5)

which completely crashes the deepstream.io server.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions