Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Unmaintained
libbluedevil
Commits
c9c11514
Commit
c9c11514
authored
Nov 14, 2014
by
David Rosca
Browse files
Check adapter for nullptr in interfacesAdded/interfacesRemoved slots
BUG: 340577
parent
e7bb4e3b
Changes
1
Hide whitespace changes
Inline
Side-by-side
bluedevil/bluedevilmanager_p.cpp
View file @
c9c11514
...
...
@@ -143,8 +143,10 @@ void ManagerPrivate::_k_interfacesAdded(const QDBusObjectPath &objectPath, const
}
else
if
(
i
.
key
()
==
"org.bluez.Device1"
)
{
QString
adapterPath
=
i
.
value
().
value
(
"Adapter"
).
value
<
QDBusObjectPath
>
().
path
();
Adapter
*
const
adapter
=
m_adapters
.
value
(
adapterPath
);
adapter
->
addDevice
(
objectPath
.
path
());
m_devAdapter
.
insert
(
objectPath
.
path
(),
adapter
);
if
(
adapter
)
{
adapter
->
addDevice
(
objectPath
.
path
());
m_devAdapter
.
insert
(
objectPath
.
path
(),
adapter
);
}
}
}
}
...
...
@@ -176,7 +178,9 @@ void ManagerPrivate::_k_interfacesRemoved(const QDBusObjectPath &objectPath, con
}
}
else
if
(
interface
==
"org.bluez.Device1"
)
{
Adapter
*
const
adapter
=
m_devAdapter
.
take
(
object
);
adapter
->
removeDevice
(
object
);
if
(
adapter
)
{
adapter
->
removeDevice
(
object
);
}
}
}
}
...
...
@@ -207,4 +211,4 @@ void ManagerPrivate::_k_bluezAdapterPoweredChanged(bool powered)
}
#include
"bluedevilmanager_p.moc"
\ No newline at end of file
#include
"bluedevilmanager_p.moc"
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment