Handle GUI console when a null is received as format or argument.

This commit is contained in:
2018-09-30 22:29:20 +01:00
parent fac608b8d3
commit 57fa2d11e5

View File

@@ -30,6 +30,7 @@
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
// Copyright © 2011-2018 Natalia Portillo // Copyright © 2011-2018 Natalia Portillo
// ****************************************************************************/ // ****************************************************************************/
using System; using System;
using System.Collections.ObjectModel; using System.Collections.ObjectModel;
using DiscImageChef.Console; using DiscImageChef.Console;
@@ -78,6 +79,8 @@ namespace DiscImageChef.Gui
static void OnWriteHandler(string format, params object[] arg) static void OnWriteHandler(string format, params object[] arg)
{ {
if(format == null || arg == null) return;
Entries.Add(new LogEntry Entries.Add(new LogEntry
{ {
Message = string.Format(format, arg), Message = string.Format(format, arg),
@@ -89,6 +92,8 @@ namespace DiscImageChef.Gui
static void OnErrorWriteHandler(string format, params object[] arg) static void OnErrorWriteHandler(string format, params object[] arg)
{ {
if(format == null || arg == null) return;
Entries.Add(new LogEntry Entries.Add(new LogEntry
{ {
Message = string.Format(format, arg), Message = string.Format(format, arg),
@@ -100,6 +105,8 @@ namespace DiscImageChef.Gui
static void OnVerboseWriteHandler(string format, params object[] arg) static void OnVerboseWriteHandler(string format, params object[] arg)
{ {
if(format == null || arg == null) return;
Entries.Add(new LogEntry Entries.Add(new LogEntry
{ {
Message = string.Format(format, arg), Message = string.Format(format, arg),
@@ -111,6 +118,8 @@ namespace DiscImageChef.Gui
static void OnDebugWriteHandler(string module, string format, params object[] arg) static void OnDebugWriteHandler(string module, string format, params object[] arg)
{ {
if(format == null || arg == null) return;
Entries.Add(new LogEntry Entries.Add(new LogEntry
{ {
Message = string.Format(format, arg), Message = string.Format(format, arg),