diff options
Diffstat (limited to 'src/BluetoothAdapter.cpp')
-rw-r--r-- | src/BluetoothAdapter.cpp | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/BluetoothAdapter.cpp b/src/BluetoothAdapter.cpp index 821e3c37..86f1084e 100644 --- a/src/BluetoothAdapter.cpp +++ b/src/BluetoothAdapter.cpp @@ -246,7 +246,10 @@ std::vector<std::string> BluetoothAdapter::get_uuids () return uuids; } -std::string BluetoothAdapter::get_modalias () +std::unique_ptr<std::string> BluetoothAdapter::get_modalias () { - return std::string(adapter1_get_modalias (object)); + const gchar *modalias= adapter1_get_modalias (object); + if (modalias == nullptr) + return std::unique_ptr<std::string>(); + return std::unique_ptr<std::string>(new std::string(modalias)); } |