Skip to content

Commit 242a668

Browse files
committed
[修复]1. 修复前置激活接口可能报空的问题
1 parent f18909a commit 242a668

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

GameFrameX.Core/Components/StateComponent.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -112,9 +112,9 @@ internal override bool ReadyToInactive
112112
/// 激活状态的时候异步读取数据
113113
/// </summary>
114114
/// <returns>返回查询的数据结果对象,没有数据返回null</returns>
115-
protected virtual async Task ActiveReadStateAsync()
115+
protected virtual Task<TState> ActiveReadStateAsync()
116116
{
117-
await Task.CompletedTask;
117+
return Task.FromResult<TState>(null);
118118
}
119119

120120
/// <summary>
@@ -130,7 +130,7 @@ public async Task ReadStateAsync()
130130
{
131131
try
132132
{
133-
await ActiveReadStateAsync();
133+
State = await ActiveReadStateAsync();
134134
}
135135
catch (Exception e)
136136
{

0 commit comments

Comments
 (0)