[vlc-commits] messages: do nothing if logger is NULL

Rémi Denis-Courmont git at videolan.org
Wed Feb 20 19:06:40 CET 2019


vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Wed Feb 20 17:49:57 2019 +0200| [24469927a2b8068e16ace47acaf1d2e525955c6a] | committer: Rémi Denis-Courmont

messages: do nothing if logger is NULL

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=24469927a2b8068e16ace47acaf1d2e525955c6a
---

 src/misc/messages.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/src/misc/messages.c b/src/misc/messages.c
index 84b22478f9..f61d0d95c2 100644
--- a/src/misc/messages.c
+++ b/src/misc/messages.c
@@ -51,12 +51,12 @@ static void vlc_vaLogCallback(vlc_logger_t *logger, int type,
                               const vlc_log_t *item, const char *format,
                               va_list ap)
 {
-    int canc;
+    if (logger != NULL) {
+        int canc = vlc_savecancel();
 
-    assert(logger != NULL);
-    canc = vlc_savecancel();
-    logger->ops->log(logger->sys, type, item, format, ap);
-    vlc_restorecancel(canc);
+        logger->ops->log(logger->sys, type, item, format, ap);
+        vlc_restorecancel(canc);
+    }
 }
 
 static void vlc_LogCallback(vlc_logger_t *logger, int type,



More information about the vlc-commits mailing list