mirror of
https://github.com/aharabada/glitchy-engine-beef.git
synced 2026-09-05 13:01:52 +00:00
Fixed null pointer exception in ShowScriptEditor when script component has no instance
This commit is contained in:
@@ -809,8 +809,9 @@ static class ScriptEngine
|
||||
|
||||
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);
|
||||
|
||||
if (scriptClass == null)
|
||||
@@ -823,6 +824,8 @@ static class ScriptEngine
|
||||
|
||||
#unwarn
|
||||
void*[2] args = .(&entityId, monoReflectionType);
|
||||
|
||||
let method = s_EntityEditor.GetMethod("ShowDefaultEntityEditor", 2);
|
||||
|
||||
s_EntityEditor.Invoke(method, null, &args);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user