From 426d18ed2a7755b38556ac258d54bef951d5d4ec Mon Sep 17 00:00:00 2001 From: Seth Alves Date: Fri, 13 Apr 2018 13:20:06 -0700 Subject: [PATCH] code review --- libraries/networking/src/NodeList.cpp | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/libraries/networking/src/NodeList.cpp b/libraries/networking/src/NodeList.cpp index 3c2b4cd336..13931be2ac 100644 --- a/libraries/networking/src/NodeList.cpp +++ b/libraries/networking/src/NodeList.cpp @@ -416,7 +416,9 @@ void NodeList::handleDSPathQuery(const QString& newPath) { if (_domainHandler.isServerless()) { if (_domainHandler.isConnected()) { auto viewpoint = _domainHandler.getViewPointFromNamedPath(newPath); - DependencyManager::get()->goToViewpointForPath(viewpoint, newPath); + if (!newPath.isEmpty()) { + DependencyManager::get()->goToViewpointForPath(viewpoint, newPath); + } } else { _domainHandler.setPendingPath(newPath); } @@ -437,7 +439,9 @@ void NodeList::sendPendingDSPathQuery() { if (_domainHandler.isServerless()) { auto viewpoint = _domainHandler.getViewPointFromNamedPath(pendingPath); - DependencyManager::get()->goToViewpointForPath(viewpoint, pendingPath); + if (!pendingPath.isEmpty()) { + DependencyManager::get()->goToViewpointForPath(viewpoint, pendingPath); + } } else { qCDebug(networking) << "Attempting to send pending query to DS for path" << pendingPath; // this is a slot triggered if we just established a network link with a DS and want to send a path query @@ -510,7 +514,7 @@ void NodeList::processDomainServerPathResponse(QSharedPointer m QString viewpoint = QString::fromUtf8(message->getRawMessage() + message->getPosition(), numViewpointBytes); // Hand it off to the AddressManager so it can handle it as a relative viewpoint - if (DependencyManager::get()->goToViewpointForPath(viewpoint, pathQuery)) { + if (!pathQuery.isEmpty() && DependencyManager::get()->goToViewpointForPath(viewpoint, pathQuery)) { qCDebug(networking) << "Going to viewpoint" << viewpoint << "which was the lookup result for path" << pathQuery; } else { qCDebug(networking) << "Could not go to viewpoint" << viewpoint