Removed extraneous error checking

This commit is contained in:
EricLiu2000
2019-06-13 16:04:20 -04:00
parent b7288edd9a
commit 44ca4d4db1
2 changed files with 3 additions and 7 deletions
+2 -3
View File
@@ -149,12 +149,11 @@ void Communication::readTask() {
if(packetizer->input(readBytes)) {
for(auto& packet : packetizer->output()) {
std::shared_ptr<Message> msg;
if(!decoder->decode(msg, packet)) {
err(APIError::Unknown); // TODO Use specific error
if(!decoder->decode(msg, packet))
continue;
}
std::lock_guard<std::mutex> lk(messageCallbacksLock);
for(auto& cb : messageCallbacks) {
if(!closing) { // We might have closed while reading or processing
cb.second.callIfMatch(msg);