aboutsummaryrefslogtreecommitdiffstats
path: root/src/db/upnp
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/db/upnp/Directory.cxx18
1 files changed, 9 insertions, 9 deletions
diff --git a/src/db/upnp/Directory.cxx b/src/db/upnp/Directory.cxx
index 4a6f20185..bc871a448 100644
--- a/src/db/upnp/Directory.cxx
+++ b/src/db/upnp/Directory.cxx
@@ -126,21 +126,21 @@ protected:
}
bool checkobjok() {
- bool ok = !m_tobj.m_id.empty() && !m_tobj.m_pid.empty() &&
- !m_tobj.m_title.empty();
+ if (m_tobj.m_id.empty() || m_tobj.m_pid.empty() ||
+ m_tobj.m_title.empty())
+ return false;
- if (ok && m_tobj.type == UPnPDirObject::Type::ITEM) {
+ if (m_tobj.type == UPnPDirObject::Type::ITEM) {
const char *item_class_name =
m_tobj.m_props["upnp:class"].c_str();
auto item_class = ParseItemClass(item_class_name);
- if (item_class == UPnPDirObject::ItemClass::UNKNOWN) {
- ok = false;
- } else {
- m_tobj.item_class = item_class;
- }
+ if (item_class == UPnPDirObject::ItemClass::UNKNOWN)
+ return false;
+
+ m_tobj.item_class = item_class;
}
- return ok;
+ return true;
}
virtual void EndElement(const XML_Char *name)