From e81cc56ca29a5b1cb44b8cebca3dc93af649dbec Mon Sep 17 00:00:00 2001 From: Kinshuk Bairagi Date: Mon, 30 May 2022 17:01:27 +0530 Subject: [PATCH] osx: Fix segfault at GetPhone (#60) GetPhone() handle nullptr of httpServer, before init of config --- tinyphone-osx/Tinyphone.xcodeproj/project.pbxproj | 2 +- tinyphone/baseapp.cpp | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/tinyphone-osx/Tinyphone.xcodeproj/project.pbxproj b/tinyphone-osx/Tinyphone.xcodeproj/project.pbxproj index 60becce..1c9ff3d 100644 --- a/tinyphone-osx/Tinyphone.xcodeproj/project.pbxproj +++ b/tinyphone-osx/Tinyphone.xcodeproj/project.pbxproj @@ -620,7 +620,7 @@ LIBRARY_SEARCH_PATHS = ( "../lib/statsd-cpp/build-osx/lib", "$(inherited)", - "/usr/local/opt/opencore-amr/lib", + /usr/local/homebrew/lib/, /usr/local/lib, ); MACOSX_DEPLOYMENT_TARGET = 10.15; diff --git a/tinyphone/baseapp.cpp b/tinyphone/baseapp.cpp index 83fce6d..8f5eaeb 100644 --- a/tinyphone/baseapp.cpp +++ b/tinyphone/baseapp.cpp @@ -190,7 +190,10 @@ namespace tp { } TinyPhone* GetPhone(){ - return tp::tpHttpServer->tinyPhone; + if (tp::tpHttpServer != nullptr) + return tp::tpHttpServer->tinyPhone; + else + return nullptr; }