Skip to content

Commit 340dbd1

Browse files
committed
Remove impl nullptr checks
This check wasn't used everywhere and it shouldn't be possible to have a DashboardClient without an impl_ as it is set in the constructor.
1 parent 6602e81 commit 340dbd1

File tree

1 file changed

+1
-33
lines changed

1 file changed

+1
-33
lines changed

src/ur/dashboard_client.cpp

Lines changed: 1 addition & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -64,50 +64,27 @@ DashboardClient::DashboardClient(const std::string& host, const ClientPolicy cli
6464

6565
bool DashboardClient::connect(const size_t max_num_tries, const std::chrono::milliseconds reconnection_time)
6666
{
67-
if (impl_ == nullptr)
68-
{
69-
throw UrException("DashboardClient::connect called, but impl_ is nullptr. This should not happen.");
70-
}
7167
bool success = impl_->connect(max_num_tries, reconnection_time);
7268
return success;
7369
}
7470

7571
void DashboardClient::disconnect()
7672
{
77-
if (impl_)
78-
{
79-
impl_->disconnect();
80-
}
81-
else
82-
{
83-
throw UrException("DashboardClient::disconnect called, but impl_ is nullptr. This should not happen.");
84-
}
73+
impl_->disconnect();
8574
}
8675

8776
std::string DashboardClient::sendAndReceive(const std::string& text)
8877
{
89-
if (impl_ == nullptr)
90-
{
91-
throw UrException("DashboardClient::sendAndReceive called, but impl_ is nullptr. This should not happen.");
92-
}
9378
return impl_->sendAndReceive(text);
9479
}
9580

9681
bool DashboardClient::sendRequest(const std::string& command, const std::string& expected)
9782
{
98-
if (impl_ == nullptr)
99-
{
100-
throw UrException("DashboardClient::sendAndReceive called, but impl_ is nullptr. This should not happen.");
101-
}
10283
return impl_->sendRequest(command, expected);
10384
}
10485

10586
std::string DashboardClient::sendRequestString(const std::string& command, const std::string& expected)
10687
{
107-
if (impl_ == nullptr)
108-
{
109-
throw UrException("DashboardClient::sendRequestString called, but impl_ is nullptr. This should not happen.");
110-
}
11188
return impl_->sendRequestString(command, expected);
11289
}
11390

@@ -588,20 +565,11 @@ void DashboardClient::assertVersion(const std::string& e_series_min_ver, const s
588565

589566
timeval DashboardClient::getConfiguredReceiveTimeout() const
590567
{
591-
if (impl_ == nullptr)
592-
{
593-
throw UrException("DashboardClient::getConfiguredReceiveTimeout called, but impl_ is nullptr. This should not "
594-
"happen.");
595-
}
596568
return impl_->getConfiguredReceiveTimeout();
597569
}
598570

599571
void DashboardClient::setReceiveTimeout(const timeval& timeout)
600572
{
601-
if (impl_ == nullptr)
602-
{
603-
throw UrException("DashboardClient::setReceiveTimeout called, but impl_ is nullptr. This should not happen.");
604-
}
605573
impl_->setReceiveTimeout(timeout);
606574
}
607575
} // namespace urcl

0 commit comments

Comments
 (0)