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

TypeError: Cannot read properties of undefined (reading 'push') #415

Open
ChristianSiegert opened this issue Nov 2, 2022 · 0 comments
Open

Comments

@ChristianSiegert
Copy link

I have received the following error many times now (but cannot reproduce it reliably):

error: (in promise) TypeError: Cannot read properties of undefined (reading 'push')
          () => this.#available_connections!.push(client),
                                             ^
    at PoolClient.<anonymous> ([redacted]/vendor/deno.land/x/[email protected]/pool.ts:191:46)
    at PoolClient.release ([redacted]/vendor/deno.land/x/[email protected]/client.ts:499:18)

pool.ts line 191 reads:

() => this.#available_connections!.push(client),

The exclamation mark is code smell because it suppresses a compiler warning. Without it, deno complains this.#available_connections is possibly 'undefined'. I think this case should be handled properly.

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

No branches or pull requests

1 participant