summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--NitrokeyManager.cc3
1 files changed, 3 insertions, 0 deletions
diff --git a/NitrokeyManager.cc b/NitrokeyManager.cc
index d85af91..e0e6ae3 100644
--- a/NitrokeyManager.cc
+++ b/NitrokeyManager.cc
@@ -617,6 +617,9 @@ namespace nitrokey{
DeviceModel NitrokeyManager::get_connected_device_model() const{
//FIXME throw if no device is connected or return unknown/unconnected value
+ if (device == nullptr){
+ throw std::runtime_error("device not connected");
+ }
return device->get_device_model();
}