aboutsummaryrefslogtreecommitdiff
path: root/lib/uriresolver.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lib/uriresolver.cpp')
-rw-r--r--lib/uriresolver.cpp11
1 files changed, 8 insertions, 3 deletions
diff --git a/lib/uriresolver.cpp b/lib/uriresolver.cpp
index e5f19a96..681e3842 100644
--- a/lib/uriresolver.cpp
+++ b/lib/uriresolver.cpp
@@ -1,3 +1,6 @@
+// SPDX-FileCopyrightText: 2020 Kitsune Ral <kitsune-ral@users.sf.net>
+// SPDX-License-Identifier: LGPL-2.1-or-later
+
#include "uriresolver.h"
#include "connection.h"
@@ -5,6 +8,8 @@
using namespace Quotient;
+UriResolverBase::~UriResolverBase() = default;
+
UriResolveResult UriResolverBase::visitResource(Connection* account,
const Uri& uri)
{
@@ -24,9 +29,9 @@ UriResolveResult UriResolverBase::visitResource(Connection* account,
case Uri::UserId: {
if (uri.action() == "join")
return IncorrectAction;
- if (auto* const user = account->user(uri.primaryId()))
- return visitUser(user, uri.action());
- return InvalidUri;
+ auto* user = account->user(uri.primaryId());
+ Q_ASSERT(user != nullptr);
+ return visitUser(user, uri.action());
}
case Uri::RoomId:
case Uri::RoomAlias: {