Fix 'script_class' null access when reloading a deleted C# script
(cherry picked from commit 6fd2edddc0
)
This commit is contained in:
parent
70784f983b
commit
659b89c615
1 changed files with 6 additions and 0 deletions
|
@ -783,6 +783,12 @@ void CSharpLanguage::reload_assemblies(bool p_soft_reload) {
|
||||||
|
|
||||||
for (List<Ref<CSharpScript>>::Element *E = scripts.front(); E; E = E->next()) {
|
for (List<Ref<CSharpScript>>::Element *E = scripts.front(); E; E = E->next()) {
|
||||||
Ref<CSharpScript> &script = E->get();
|
Ref<CSharpScript> &script = E->get();
|
||||||
|
// If someone removes a script from a node, deletes the script, builds, adds a script to the
|
||||||
|
// same node, then builds again, the script might have no path and also no script_class. In
|
||||||
|
// that case, we can't (and don't need to) reload it.
|
||||||
|
if (script->get_path().empty() && !script->script_class) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
to_reload.push_back(script);
|
to_reload.push_back(script);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue