Suhani Singh
Suhani Singh

Reputation: 3

Regarding connection class in RethinkDb

I am not able to understand why am I getting this error stating that connection of type Connection is not initialized if anyone could help me out with it.

enter image description here

Upvotes: 0

Views: 70

Answers (1)

BabC
BabC

Reputation: 1084

In your main method, you are writing

Connection connection; // connection is still null
UserService sut = UserService(r, connection);

But as you error message said : you cannot instantiate UserService with a connection variable that is null. You must rework your code so your variable won't be null when you initialize the UserService

Upvotes: 0

Related Questions