From 410ec008485adc42026e4444a08c615aeef16cf1 Mon Sep 17 00:00:00 2001
From: Nicolas Werner <nicolas.werner@hotmail.de>
Date: Thu, 4 Nov 2021 23:10:03 +0100
Subject: [PATCH] Fix crash in debug code for matrix uri handler

fixes #776
fixes #590
---
 src/main.cpp | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/src/main.cpp b/src/main.cpp
index f6373d2ac..f2364c596 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -174,7 +174,7 @@ main(int argc, char *argv[])
                             SingleApplication::Mode::ExcludeAppVersion |
                             SingleApplication::Mode::SecondaryNotification,
                           100,
-                          userdata);
+                          userdata == "default" ? "" : userdata);
 
     QCommandLineParser parser;
     parser.addHelpOption();
@@ -199,8 +199,9 @@ main(int argc, char *argv[])
     // This check needs to happen _after_ process(), so that we actually print help for --help when
     // Nheko is already running.
     if (app.isSecondary()) {
-        nhlog::ui()->info("Sending Matrix URL to main application: {}", matrixUri.toStdString());
-        // open uri in main instance
+        std::cout << "Sending Matrix URL to main application: " << matrixUri.toStdString()
+                  << std::endl;
+        //  open uri in main instance
         app.sendMessage(matrixUri.toUtf8());
         return 0;
     }
-- 
GitLab