From 1e66bcae1baca77c6df0851b474c24c2af13e03b Mon Sep 17 00:00:00 2001 From: David Kelly Date: Wed, 14 Dec 2016 16:43:37 -0800 Subject: [PATCH] Handle no setting manager case Can't save the fallback generated UUID for machine fingerprint if the user of this stuff doesn't have a settings file. Found this when I noticed needed to initialize com for all the assignment clients --- libraries/networking/src/FingerprintUtils.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/libraries/networking/src/FingerprintUtils.cpp b/libraries/networking/src/FingerprintUtils.cpp index cabd352999..adafb8cf36 100644 --- a/libraries/networking/src/FingerprintUtils.cpp +++ b/libraries/networking/src/FingerprintUtils.cpp @@ -10,8 +10,13 @@ // #include "FingerprintUtils.h" + #include + #include +#include +#include + #ifdef Q_OS_WIN #include #include @@ -171,6 +176,11 @@ QUuid FingerprintUtils::getMachineFingerprint() { // any errors in getting the string QUuid uuid(uuidString); if (uuid == QUuid()) { + // if you cannot read a fallback key cuz we aren't saving them, just generate one for + // this session and move on + if (DependencyManager::get().isNull()) { + return QUuid::createUuid(); + } // read fallback key (if any) Settings settings; uuid = QUuid(settings.value(FALLBACK_FINGERPRINT_KEY).toString());