From 8cac0918334edc59e7f8c3800e7663d1ab41373d Mon Sep 17 00:00:00 2001 From: Szczepan Zalega Date: Mon, 24 Apr 2017 13:58:46 +0200 Subject: Return empty value on no connection Signed-off-by: Szczepan Zalega --- NitrokeyManager.cc | 1 + 1 file changed, 1 insertion(+) diff --git a/NitrokeyManager.cc b/NitrokeyManager.cc index d2403c1..9fbd303 100644 --- a/NitrokeyManager.cc +++ b/NitrokeyManager.cc @@ -201,6 +201,7 @@ char * strndup(const char* str, size_t maxlen){ string NitrokeyManager::get_serial_number() { + if (device == nullptr) { return ""; }; switch (device->get_device_model()) { case DeviceModel::PRO: { auto response = GetStatus::CommandTransaction::run(device); -- cgit v1.2.3