Also check whether a job is valid before calling enter tree on it.

This commit is contained in:
Relintai 2022-02-14 12:50:17 +01:00
parent 10dbb857ce
commit deb664c781

View File

@ -124,7 +124,7 @@ Ref<PropInstanceJob> PropInstanceMerger::get_job() {
void PropInstanceMerger::set_job(const Ref<PropInstanceJob> &job) { void PropInstanceMerger::set_job(const Ref<PropInstanceJob> &job) {
_job = job; _job = job;
if (is_inside_tree()) { if (_job.is_valid() && is_inside_tree()) {
_job->prop_instance_enter_tree(); _job->prop_instance_enter_tree();
} }
} }