From 9e544d527a9a125e350bbada03196dcf451d1160 Mon Sep 17 00:00:00 2001 From: Thomas Haller Date: Tue, 14 May 2019 11:17:43 +0200 Subject: [PATCH] shared: fix invalid assertion in nm_utils_team_link_watcher_from_string() Fixes: a473ab431af4 ('cli: refactor team-link-watcher to/from strings') --- shared/nm-libnm-core-aux/nm-libnm-core-aux.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/shared/nm-libnm-core-aux/nm-libnm-core-aux.c b/shared/nm-libnm-core-aux/nm-libnm-core-aux.c index 7ddf326ac1..380805caaf 100644 --- a/shared/nm-libnm-core-aux/nm-libnm-core-aux.c +++ b/shared/nm-libnm-core-aux/nm-libnm-core-aux.c @@ -348,12 +348,12 @@ nm_utils_team_link_watcher_from_string (const char *str, } #if NM_MORE_ASSERTS > 5 - { + if (watcher) { gs_free char *str2 = NULL; nm_auto_unref_team_link_watcher NMTeamLinkWatcher *watcher2 = NULL; static _nm_thread_local int recursive; - nm_assert (watcher); + nm_assert (!error || !*error); if (recursive == 0) { recursive = 1; str2 = nm_utils_team_link_watcher_to_string (watcher); @@ -365,7 +365,8 @@ nm_utils_team_link_watcher_from_string (const char *str, nm_assert (recursive == 1); recursive = 0; } - } + } else + nm_assert (!error || *error); #endif return watcher;