From 29cd467ba62b2bdf49c6546e78ae3ec809c4a723 Mon Sep 17 00:00:00 2001
From: dengjunjie <dengjunjie@hnkhzn.com>
Date: 星期四, 19 六月 2025 17:50:28 +0800
Subject: [PATCH] 1
---
代码管理/WMS/WIDESEA_WMSServer/WIDESEA_Core/Helper/CodeAnalysisHelper.cs | 7 +++++--
1 files changed, 5 insertions(+), 2 deletions(-)
diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_Core/Helper/CodeAnalysisHelper.cs" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_Core/Helper/CodeAnalysisHelper.cs"
index 56bda4c..6dbad0f 100644
--- "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_Core/Helper/CodeAnalysisHelper.cs"
+++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_Core/Helper/CodeAnalysisHelper.cs"
@@ -25,7 +25,10 @@
public static T CodeAnalysis<T>(AnalysisCode analysisCode, string code)
{
Type type = typeof(T);
- T result = (T)Activator.CreateInstance(type);
+ object? obj = Activator.CreateInstance(type);
+ if (obj == null)
+ throw new Exception("瀹炰緥鍖栧璞¢敊璇�");
+ T result = (T)obj;
try
{
AnalysisRuleAttribute? analysisRule = type.GetCustomAttribute<AnalysisRuleAttribute>();
@@ -122,7 +125,7 @@
AnalysisItemRuleAttribute? analysisItemRule = propertyInfo.GetCustomAttribute<AnalysisItemRuleAttribute>();
if (analysisItemRule != null)
{
- if(analysisItemRule.AnalysisFormaType == AnalysisFormaType.BD)
+ if(analysisItemRule.AnalysisFormaType == AnalysisFormatType.BD)
{
propertyInfo.SetValue(result, code.ChangeType(propertyInfo.PropertyType));
}
--
Gitblit v1.9.3