Skip to content

Commit 4e85d01

Browse files
authored
Fix CLoadingResource::FinalizeLoadRequest crash (#3911)
* Prevent premature loading resource cancellation from finalising cyclical dependencies * GameResource.GetPromise returns null with empty path
1 parent 997db6d commit 4e85d01

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

engine/Sandbox.Engine/Resources/GameResource.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,8 +134,9 @@ internal bool PostReloadInternal()
134134
internal static GameResource GetPromise( System.Type type, string filename )
135135
{
136136
var path = FixPath( filename );
137-
var hash = path.FastHash();
137+
if ( string.IsNullOrEmpty( path ) ) return default;
138138

139+
var hash = path.FastHash();
139140
var obj = Game.Resources.Get( type, hash ) as GameResource;
140141
if ( obj != null ) return obj;
141142

0 commit comments

Comments
 (0)