Skip to content

Commit

Permalink
fix: check against null strings
Browse files Browse the repository at this point in the history
  • Loading branch information
Curve committed Apr 11, 2024
1 parent 022a6db commit 0f4e1fe
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
cmake_minimum_required(VERSION 3.21)
project(rohrkabel LANGUAGES CXX VERSION 5.0)
project(rohrkabel LANGUAGES CXX VERSION 5.1)

# --------------------------------------------------------------------------------------------------------
# Library options
Expand Down
2 changes: 1 addition & 1 deletion src/events/metadata.events.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ namespace pipewire
m_impl->events.property = [](void *data, std::uint32_t subject, const char *key, const char *type,
const char *value) {
auto &events = *reinterpret_cast<listener::events *>(data);
auto property = metadata_property{type, value, subject};
auto property = metadata_property{type ? type : "", value ? value : "", subject};

return events.at<metadata_event::property>().during(0, key, std::move(property)).value_or(0);
};
Expand Down
2 changes: 1 addition & 1 deletion src/events/registry.events.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ namespace pipewire
m_impl->events.global = [](void *data, std::uint32_t id, std::uint32_t permissions, const char *type,
std::uint32_t version, const spa_dict *props) {
auto &events = *reinterpret_cast<listener::events *>(data);
events.at<registry_event::global>().fire(global{id, version, permissions, props, type});
events.at<registry_event::global>().fire(global{id, version, permissions, props, type ? type : ""});
};

m_impl->events.global_remove = [](void *data, std::uint32_t id) {
Expand Down
8 changes: 4 additions & 4 deletions src/info/core.info.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@ namespace pipewire
.props = info->props,
.id = info->id,
.cookie = info->cookie,
.name = info->name,
.version = info->version,
.user_name = info->user_name,
.host_name = info->host_name,
.name = info->name ? info->name : "",
.version = info->version ? info->version : "",
.user_name = info->user_name ? info->user_name : "",
.host_name = info->host_name ? info->host_name : "",
};
}
} // namespace pipewire

0 comments on commit 0f4e1fe

Please sign in to comment.