Skip to content

Commit

Permalink
Merge branch 'exec_null_check' into 'master'
Browse files Browse the repository at this point in the history
[libcontentaction] Add null check, avoid crashes. Fixes JB#50251

See merge request mer-core/libcontentaction!16
  • Loading branch information
pvuorela committed Jun 16, 2020
2 parents d5445f1 + 9ebae1b commit 30c7ae8
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
5 changes: 1 addition & 4 deletions rpm/libcontentaction-qt5.spec
@@ -1,8 +1,7 @@
Name: libcontentaction-qt5
Summary: Library for associating content with actions
Version: 0.2.9
Version: 0.3.5
Release: 1
Group: System/Desktop
License: LGPLv2
URL: https://git.sailfishos.org/mer-core/libcontentaction
Source0: %{name}-%{version}.tar.bz2
Expand All @@ -25,7 +24,6 @@ libcontentaction is a library for associating content with actions.

%package devel
Summary: Development files for libcontentaction
Group: Development/System
Requires: %{name} = %{version}-%{release}

%description devel
Expand All @@ -35,7 +33,6 @@ libcontentaction library.

%package tests
Summary: Tests for libcontentaction
Group: System/X11
Requires: %{name} = %{version}-%{release}
Requires: dbus-python
Requires: pygobject2
Expand Down
8 changes: 7 additions & 1 deletion src/exec.cpp
Expand Up @@ -111,7 +111,9 @@ ExecPrivate::ExecPrivate(QSharedPointer<MDesktopEntry> desktopEntry,

ExecPrivate::~ExecPrivate()
{
g_object_unref(appInfo);
if (appInfo) {
g_object_unref(appInfo);
}
}

static void setupProcessIds(gpointer)
Expand All @@ -131,6 +133,10 @@ static void setupProcessIds(gpointer)

void ExecPrivate::trigger(bool) const
{
if (!appInfo) {
LCA_WARNING << "Exec action triggered without proper appInfo";
return;
}
// Ignore whether the user wanted to wait for the application to start.
GError *error = 0;
GList *uris = NULL;
Expand Down

0 comments on commit 30c7ae8

Please sign in to comment.