mirror of
https://github.com/ElementsProject/elements.git
synced 2026-08-20 13:37:28 +02:00
Introduce user getter to avoid null pointers
This commit is contained in:
parent
2f5d051394
commit
2a34dbdaa5
3 changed files with 7 additions and 1 deletions
|
|
@ -30,6 +30,10 @@
|
|||
//Thread local rpc user name for logging purposes
|
||||
boost::thread_specific_ptr<std::string> userInstance;
|
||||
|
||||
std::string getUser() {
|
||||
return (userInstance.get() ? *userInstance.get() : "UNDEFINED_USER");
|
||||
}
|
||||
|
||||
using namespace RPCServer;
|
||||
using namespace std;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue