From 5c2ea521186a6652ec058b126704f3bb3910c441 Mon Sep 17 00:00:00 2001 From: monitor1394 Date: Thu, 17 Feb 2022 08:39:55 +0800 Subject: [PATCH] Fixed MissingReferenceException #183 --- Assets/XCharts/Runtime/Helper/CheckHelper.cs | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/Assets/XCharts/Runtime/Helper/CheckHelper.cs b/Assets/XCharts/Runtime/Helper/CheckHelper.cs index d579f67f..f9cb20dd 100644 --- a/Assets/XCharts/Runtime/Helper/CheckHelper.cs +++ b/Assets/XCharts/Runtime/Helper/CheckHelper.cs @@ -18,12 +18,18 @@ private static bool IsColorAlphaZero(Color color) public static string CheckChart(BaseGraph chart) { - if (chart is BaseChart) return CheckChart((BaseChart)chart); - else return string.Empty; + if(chart == null) + return string.Empty; + if (chart is BaseChart) + return CheckChart((BaseChart)chart); + else + return string.Empty; } public static string CheckChart(BaseChart chart) { + if(chart == null) + return string.Empty; var sb = ChartHelper.sb; sb.Length = 0; CheckName(chart, sb);