summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSzczepan Zalega <szczepan@nitrokey.com>2017-04-24 13:58:46 +0200
committerSzczepan Zalega <szczepan@nitrokey.com>2017-04-26 10:10:30 +0200
commit8cac0918334edc59e7f8c3800e7663d1ab41373d (patch)
treee3ebda6316f0eac5ec5444b0a65907b993cf420d
parent55473f8c6d8d623992f2fffcbcc28749c118ab6d (diff)
downloadlibnitrokey-8cac0918334edc59e7f8c3800e7663d1ab41373d.tar.gz
libnitrokey-8cac0918334edc59e7f8c3800e7663d1ab41373d.tar.bz2
Return empty value on no connection
Signed-off-by: Szczepan Zalega <szczepan@nitrokey.com>
-rw-r--r--NitrokeyManager.cc1
1 files changed, 1 insertions, 0 deletions
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);