diff options
author | Rémi Verschelde <rverschelde@gmail.com> | 2023-09-12 17:47:43 +0200 |
---|---|---|
committer | Rémi Verschelde <rverschelde@gmail.com> | 2023-09-12 17:47:43 +0200 |
commit | ff7428f4cda091044de28224d40da57ef1c75126 (patch) | |
tree | 0a1746dc643ddea8ae9b79532f81823b5e2c7126 /main/main.cpp | |
parent | 98b50eb3083094a352b36b184d7b60b77ad982fe (diff) | |
parent | a29416e3321b678c751f5bd6ebbebed544af09aa (diff) | |
download | redot-engine-ff7428f4cda091044de28224d40da57ef1c75126.tar.gz |
Merge pull request #81568 from AThousandShips/null_check_scene_main
[Scene,Main] Replace `ERR_FAIL_COND` with `ERR_FAIL_NULL` where applicable
Diffstat (limited to 'main/main.cpp')
-rw-r--r-- | main/main.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/main/main.cpp b/main/main.cpp index 32262b50b3..aa2f5f2451 100644 --- a/main/main.cpp +++ b/main/main.cpp @@ -289,7 +289,7 @@ void initialize_physics() { // Physics server not found, Use the default physics physics_server_3d = PhysicsServer3DManager::get_singleton()->new_default_server(); } - ERR_FAIL_COND(!physics_server_3d); + ERR_FAIL_NULL(physics_server_3d); physics_server_3d->init(); // 2D Physics server @@ -299,7 +299,7 @@ void initialize_physics() { // Physics server not found, Use the default physics physics_server_2d = PhysicsServer2DManager::get_singleton()->new_default_server(); } - ERR_FAIL_COND(!physics_server_2d); + ERR_FAIL_NULL(physics_server_2d); physics_server_2d->init(); } @@ -3022,7 +3022,7 @@ bool Main::start() { return false; } else { Object *ml = ClassDB::instantiate(main_loop_type); - ERR_FAIL_COND_V_MSG(!ml, false, "Can't instance MainLoop type."); + ERR_FAIL_NULL_V_MSG(ml, false, "Can't instance MainLoop type."); main_loop = Object::cast_to<MainLoop>(ml); if (!main_loop) { @@ -3302,7 +3302,7 @@ bool Main::start() { scene = scenedata->instantiate(); } - ERR_FAIL_COND_V_MSG(!scene, false, "Failed loading scene: " + local_game_path); + ERR_FAIL_NULL_V_MSG(scene, false, "Failed loading scene: " + local_game_path + "."); sml->add_current_scene(scene); #ifdef MACOS_ENABLED |