Skip to content

Commit

Permalink
osx: Fix segfault at GetPhone (#60)
Browse files Browse the repository at this point in the history
GetPhone() handle nullptr of httpServer, before init of config
  • Loading branch information
kingster authored May 30, 2022
1 parent f7699c7 commit e81cc56
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion tinyphone-osx/Tinyphone.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
5 changes: 4 additions & 1 deletion tinyphone/baseapp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,10 @@ namespace tp {
}

TinyPhone* GetPhone(){
return tp::tpHttpServer->tinyPhone;
if (tp::tpHttpServer != nullptr)
return tp::tpHttpServer->tinyPhone;
else
return nullptr;
}


Expand Down

0 comments on commit e81cc56

Please sign in to comment.