mirror of
https://github.com/aharabada/glitchy-engine-beef.git
synced 2026-09-05 21:01:52 +00:00
Fixed null pointer exception in ShowScriptEditor when script component has no instance
This commit is contained in:
@@ -809,7 +809,8 @@ static class ScriptEngine
|
|||||||
|
|
||||||
public static void ShowScriptEditor(Entity entity, ScriptComponent* scriptComponent)
|
public static void ShowScriptEditor(Entity entity, ScriptComponent* scriptComponent)
|
||||||
{
|
{
|
||||||
let method = s_EntityEditor.GetMethod("ShowDefaultEntityEditor", 2);
|
if (scriptComponent.Instance == null)
|
||||||
|
return;
|
||||||
|
|
||||||
ScriptClass scriptClass = ScriptEngine.GetScriptClass(scriptComponent.ScriptClassName);
|
ScriptClass scriptClass = ScriptEngine.GetScriptClass(scriptComponent.ScriptClassName);
|
||||||
|
|
||||||
@@ -824,6 +825,8 @@ static class ScriptEngine
|
|||||||
#unwarn
|
#unwarn
|
||||||
void*[2] args = .(&entityId, monoReflectionType);
|
void*[2] args = .(&entityId, monoReflectionType);
|
||||||
|
|
||||||
|
let method = s_EntityEditor.GetMethod("ShowDefaultEntityEditor", 2);
|
||||||
|
|
||||||
s_EntityEditor.Invoke(method, null, &args);
|
s_EntityEditor.Invoke(method, null, &args);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user