diff --git a/src/libcamera/yaml_parser.cpp b/src/libcamera/yaml_parser.cpp
index 5ca5fb8235b5e761..a5e424615c263f2d 100644
--- a/src/libcamera/yaml_parser.cpp
+++ b/src/libcamera/yaml_parser.cpp
@@ -194,7 +194,7 @@ YamlObject::Getter<double>::get(const YamlObject &obj) const
 	if (obj.type_ != Type::Value)
 		return std::nullopt;
 
-	if (obj.value_ == "")
+	if (obj.value_.empty())
 		return std::nullopt;
 
 	char *end;
