From 8992b66df5437a1f1d6fb7f45ef82ae779660ce8 Mon Sep 17 00:00:00 2001
From: biwa <6475593+biwa@users.noreply.github.com>
Date: Fri, 7 Jan 2022 11:51:04 +0100
Subject: [PATCH] UDBScript: fixed a problem where the UDB.log() method crashed
when a non-string object was passed to it
---
Source/Plugins/UDBScript/API/UDBWrapper.cs | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/Source/Plugins/UDBScript/API/UDBWrapper.cs b/Source/Plugins/UDBScript/API/UDBWrapper.cs
index 5494c068..254cb496 100644
--- a/Source/Plugins/UDBScript/API/UDBWrapper.cs
+++ b/Source/Plugins/UDBScript/API/UDBWrapper.cs
@@ -259,9 +259,12 @@ namespace CodeImp.DoomBuilder.UDBScript.Wrapper
/// Adds a line to the script log. Also shows the script running dialog.
///
/// Line to add to the script log
- public void log(string text)
+ public void log(object text)
{
- logger.Report(text);
+ if (text == null)
+ return;
+
+ logger.Report(text.ToString());
}
///