浏览代码

Fix missing null checks in Mono Binding of GD

The print methods of mono binding was missing null checks for the params
Jonas 5 年之前
父节点
当前提交
11258db001
共有 1 个文件被更改,包括 4 次插入4 次删除
  1. 4 4
      modules/mono/glue/Managed/Files/GD.cs

+ 4 - 4
modules/mono/glue/Managed/Files/GD.cs

@@ -93,22 +93,22 @@ namespace Godot
 
         public static void PrintErr(params object[] what)
         {
-            godot_icall_GD_printerr(Array.ConvertAll(what, x => x.ToString()));
+            godot_icall_GD_printerr(Array.ConvertAll(what, x => x?.ToString()));
         }
 
         public static void PrintRaw(params object[] what)
         {
-            godot_icall_GD_printraw(Array.ConvertAll(what, x => x.ToString()));
+            godot_icall_GD_printraw(Array.ConvertAll(what, x => x?.ToString()));
         }
 
         public static void PrintS(params object[] what)
         {
-            godot_icall_GD_prints(Array.ConvertAll(what, x => x.ToString()));
+            godot_icall_GD_prints(Array.ConvertAll(what, x => x?.ToString()));
         }
 
         public static void PrintT(params object[] what)
         {
-            godot_icall_GD_printt(Array.ConvertAll(what, x => x.ToString()));
+            godot_icall_GD_printt(Array.ConvertAll(what, x => x?.ToString()));
         }
 
         public static float Randf()