summaryrefslogtreecommitdiff
path: root/src/cam/main.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/cam/main.cpp')
-rw-r--r--src/cam/main.cpp11
1 files changed, 7 insertions, 4 deletions
diff --git a/src/cam/main.cpp b/src/cam/main.cpp
index d8115cd8..53c2ffde 100644
--- a/src/cam/main.cpp
+++ b/src/cam/main.cpp
@@ -300,8 +300,9 @@ std::string CamApp::cameraName(const Camera *camera)
* Construct the name from the camera location, model and ID. The model
* is only used if the location isn't present or is set to External.
*/
- if (props.contains(properties::Location)) {
- switch (*props.get(properties::Location)) {
+ const auto &location = props.get(properties::Location);
+ if (location) {
+ switch (*location) {
case properties::CameraLocationFront:
addModel = false;
name = "Internal front camera ";
@@ -316,12 +317,14 @@ std::string CamApp::cameraName(const Camera *camera)
}
}
- if (addModel && props.contains(properties::Model)) {
+ if (addModel) {
/*
* If the camera location is not availble use the camera model
* to build the camera name.
*/
- name = "'" + *props.get(properties::Model) + "' ";
+ const auto &model = props.get(properties::Model);
+ if (model)
+ name = "'" + *model + "' ";
}
name += "(" + camera->id() + ")";