diff options
author | RĂ©mi Verschelde <rverschelde@gmail.com> | 2019-07-01 14:59:29 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-07-01 14:59:29 +0200 |
commit | 6b30f284a0544972f761be3e92ad8d1b176c9f9f (patch) | |
tree | 5edd19124ce8c9265a869a8171541d5ff7c60e17 /scene/3d | |
parent | b0ce9401ffa731cc346ab6762fd0794709634428 (diff) | |
parent | 7d8d337b2c47df88498067ff9091386691242144 (diff) |
Merge pull request #29980 from Dentrax/directed-by-qarmin
Fix some editor crashes
Diffstat (limited to 'scene/3d')
-rw-r--r-- | scene/3d/spatial.cpp | 2 | ||||
-rw-r--r-- | scene/3d/visual_instance.cpp | 2 |
2 files changed, 3 insertions, 1 deletions
diff --git a/scene/3d/spatial.cpp b/scene/3d/spatial.cpp index efd418e3c7..1a41a31253 100644 --- a/scene/3d/spatial.cpp +++ b/scene/3d/spatial.cpp @@ -506,6 +506,8 @@ bool Spatial::is_set_as_toplevel() const { Ref<World> Spatial::get_world() const { ERR_FAIL_COND_V(!is_inside_world(), Ref<World>()); + ERR_FAIL_COND_V(!data.viewport, Ref<World>()); + return data.viewport->find_world(); } diff --git a/scene/3d/visual_instance.cpp b/scene/3d/visual_instance.cpp index 4bb4d18071..5141c84803 100644 --- a/scene/3d/visual_instance.cpp +++ b/scene/3d/visual_instance.cpp @@ -60,7 +60,7 @@ void VisualInstance::_notification(int p_what) { if (skeleton) VisualServer::get_singleton()->instance_attach_skeleton( instance, skeleton->get_skeleton() ); */ - + ERR_FAIL_COND(get_world().is_null()); VisualServer::get_singleton()->instance_set_scenario(instance, get_world()->get_scenario()); _update_visibility(); |