Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Plasma
Discover
Commits
1e289501
Commit
1e289501
authored
Nov 15, 2021
by
Aleix Pol Gonzalez
🐧
Committed by
Aleix Pol Gonzalez
Nov 15, 2021
Browse files
flatpak: Check for errors before using the value
(cherry picked from commit
c37e9be4
)
parent
dc67ef22
Changes
1
Hide whitespace changes
Inline
Side-by-side
libdiscover/backends/FlatpakBackend/FlatpakNotifier.cpp
View file @
1e289501
...
...
@@ -95,6 +95,10 @@ void FlatpakNotifier::loadRemoteUpdates(Installation *installation)
g_autoptr
(
GPtrArray
)
fetchedUpdates
=
flatpak_installation_list_installed_refs_for_update
(
installation
->
m_installation
,
cancellable
,
&
localError
);
bool
hasUpdates
=
false
;
if
(
!
fetchedUpdates
)
{
qWarning
()
<<
"Failed to get list of installed refs for listing updates: "
<<
localError
->
message
;
return
false
;
}
for
(
uint
i
=
0
;
!
hasUpdates
&&
i
<
fetchedUpdates
->
len
;
i
++
)
{
FlatpakInstalledRef
*
ref
=
FLATPAK_INSTALLED_REF
(
g_ptr_array_index
(
fetchedUpdates
,
i
));
const
QString
refName
=
QString
::
fromUtf8
(
flatpak_ref_get_name
(
FLATPAK_REF
(
ref
)));
...
...
@@ -106,9 +110,6 @@ void FlatpakNotifier::loadRemoteUpdates(Installation *installation)
}
hasUpdates
=
true
;
}
if
(
!
fetchedUpdates
)
{
qWarning
()
<<
"Failed to get list of installed refs for listing updates: "
<<
localError
->
message
;
}
return
hasUpdates
;
}));
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a 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