From 9d00a52c9c8c7ed52efde9b9cbed06823a97a21d Mon Sep 17 00:00:00 2001 From: cary <39078800+caryliu1999@users.noreply.github.com> Date: Mon, 17 Aug 2020 22:59:47 +0800 Subject: [PATCH] Add fault-tolerant handling for renderPipeline startup. (#7156) --- cocos/core/game.ts | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/cocos/core/game.ts b/cocos/core/game.ts index 292f9e58e8..f3aafd15ba 100644 --- a/cocos/core/game.ts +++ b/cocos/core/game.ts @@ -638,7 +638,13 @@ export class Game extends EventTarget { this.setRenderPipeline(); } else { - this.setRenderPipeline(asset); + try { + this.setRenderPipeline(asset); + } catch (e) { + console.warn(e); + console.warn(`Failed load renderpipeline: ${renderPipeline}, engine failed to initialize, will fallback to default pipeline`); + this.setRenderPipeline(); + } } this._safeEmit(Game.EVENT_GAME_INITED); if (useSplash) {