File tree 1 file changed +11
-3
lines changed
GameFrameX.Core/Components
1 file changed +11
-3
lines changed Original file line number Diff line number Diff line change @@ -112,9 +112,9 @@ internal override bool ReadyToInactive
112
112
/// 激活状态的时候异步读取数据
113
113
/// </summary>
114
114
/// <returns>返回查询的数据结果对象,没有数据返回null</returns>
115
- protected virtual Task < TState > ActiveReadStateAsync ( )
115
+ protected virtual async Task ActiveReadStateAsync ( )
116
116
{
117
- return null ;
117
+ await Task . CompletedTask ;
118
118
}
119
119
120
120
/// <summary>
@@ -123,7 +123,15 @@ protected virtual Task<TState> ActiveReadStateAsync()
123
123
/// <returns></returns>
124
124
public async Task ReadStateAsync ( )
125
125
{
126
- State = await ActiveReadStateAsync ( ) ;
126
+ try
127
+ {
128
+ await ActiveReadStateAsync ( ) ;
129
+ }
130
+ catch ( Exception e )
131
+ {
132
+ LogHelper . Error ( e ) ;
133
+ }
134
+
127
135
if ( State . IsNull ( ) )
128
136
{
129
137
State = await GameDb . FindAsync < TState > ( ActorId ) ;
You can’t perform that action at this time.
0 commit comments