File tree Expand file tree Collapse file tree
GameFrameX.Core/Components Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -112,9 +112,9 @@ internal override bool ReadyToInactive
112112 /// 激活状态的时候异步读取数据
113113 /// </summary>
114114 /// <returns>返回查询的数据结果对象,没有数据返回null</returns>
115- protected virtual Task < TState > ActiveReadStateAsync ( )
115+ protected virtual async Task ActiveReadStateAsync ( )
116116 {
117- return null ;
117+ await Task . CompletedTask ;
118118 }
119119
120120 /// <summary>
@@ -123,7 +123,15 @@ protected virtual Task<TState> ActiveReadStateAsync()
123123 /// <returns></returns>
124124 public async Task ReadStateAsync ( )
125125 {
126- State = await ActiveReadStateAsync ( ) ;
126+ try
127+ {
128+ await ActiveReadStateAsync ( ) ;
129+ }
130+ catch ( Exception e )
131+ {
132+ LogHelper . Error ( e ) ;
133+ }
134+
127135 if ( State . IsNull ( ) )
128136 {
129137 State = await GameDb . FindAsync < TState > ( ActorId ) ;
You can’t perform that action at this time.
0 commit comments