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
Plasma
libksysguard
Commits
a6860b99
Commit
a6860b99
authored
Nov 20, 2020
by
Arjen Hiemstra
Browse files
Don't crash SensorFaceControllerTest if we don't have StorageVolume
parent
4bcc11ab
Changes
1
Hide whitespace changes
Inline
Side-by-side
autotests/sensorfacecontrollertest.cpp
View file @
a6860b99
...
...
@@ -63,6 +63,10 @@ private Q_SLOTS:
const
auto
storageAccess
=
storageAccesses
[
i
].
as
<
Solid
::
StorageAccess
>
();
const
auto
blockDevice
=
storageAccesses
[
i
].
as
<
Solid
::
Block
>
();
const
auto
storageVolume
=
storageAccesses
[
i
].
as
<
Solid
::
StorageVolume
>
();
if
(
!
storageVolume
)
{
continue
;
}
const
QString
newPrefix
=
QStringLiteral
(
"disk/"
)
+
(
storageVolume
->
uuid
().
isEmpty
()
?
storageVolume
->
label
()
:
storageVolume
->
uuid
());
// Old code uses "disk/sdc2_(8:34)/..."
QString
device
=
blockDevice
->
device
().
mid
(
strlen
(
"/dev/"
));
...
...
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