Skip to content

Commit

Permalink
unity: fix error when reloading a scene
Browse files Browse the repository at this point in the history
  • Loading branch information
wgreenberg committed Jan 20, 2025
1 parent 14f2a78 commit 9ac2852
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/Common/Unity/AssetManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -156,8 +156,10 @@ export class AssetFile {
this.waitForHeaderPromise = null;
}

public waitForHeader(): Promise<void> {
return assertExists(this.waitForHeaderPromise);
public async waitForHeader() {
if (this.waitForHeaderPromise !== null) {
await this.waitForHeaderPromise;
}
}

private async initFullInternal(dataFetcher: DataFetcher): Promise<void> {
Expand Down

0 comments on commit 9ac2852

Please sign in to comment.