Repository: godot
Issue: Editor Inspector Plugin can_handle() can pass uninitialized objects.
Labels: bug,topic:core

<!-- Please search existing issues for potential duplicates before filing yours:	
https://github.com/godotengine/godot/issues?q=is%3Aissue	
-->

**Godot version:**
<!-- Specify commit hash if using non-official build. -->
3.2.2 Stable


**OS/device including version:**
<!-- Specify GPU model, drivers, and the backend (GLES2, GLES3, Vulkan) if graphics-related. -->
Win10 64-bit

**Issue description:**
<!-- What happened, and what was expected. -->
This is a minor edge case thing, but when overriding is_class() and possibly the other class related methods, this causes an unexpected engine and script error when opening that GDScript from the file dock.

![godot windows tools 64_jbFIcH06tC](https://user-images.githubusercontent.com/13004169/87869806-473d1f00-c9ab-11ea-828d-9260f52282d1.png)

![explorer_RfH9CL8QGS](https://user-images.githubusercontent.com/13004169/87869822-6dfb5580-c9ab-11ea-99b4-a26b2d0c04f2.png)


This is the stack.

```
 	godot.windows.tools.64.exe!GDScript::call(const StringName & p_method, const Variant * * p_args, int p_argcount, Variant::CallError & r_error) Line 669	C++
 	godot.windows.tools.64.exe!Variant::call_ptr(const StringName & p_method, const Variant * * p_args, int p_argcount, Variant * r_ret, Variant::CallError & r_error) Line 1127	C++
 	godot.windows.tools.64.exe!GDScriptFunction::call(GDScriptInstance * p_instance, const Variant * * p_args, int p_argcount, Variant::CallError & r_err, GDScriptFunction::CallState * p_state) Line 1086	C++
 	godot.windows.tools.64.exe!GDScriptInstance::call(const StringName & p_method, const Variant * * p_args, int p_argcount, Variant::CallError & r_error) Line 1237	C++
 	godot.windows.tools.64.exe!ScriptInstance::call(const StringName & p_method, const Variant & p_arg1, const Variant & p_arg2, const Variant & p_arg3, const Variant & p_arg4, const Variant & p_arg5) Line 310	C++
 	godot.windows.tools.64.exe!EditorInspectorPlugin::can_handle(Object * p_object) Line 912	C++
 	godot.windows.tools.64.exe!EditorInspector::update_tree() Line 1462	C++
 	godot.windows.tools.64.exe!EditorInspector::edit(Object * p_object) Line 1880	C++
 	godot.windows.tools.64.exe!EditorNode::_edit_current() Line 1790	C++
 	godot.windows.tools.64.exe!EditorNode::push_item(Object * p_object, const String & p_property, bool p_inspector_only) Line 1714	C++
 	godot.windows.tools.64.exe!InspectorDock::_resource_selected(const Ref<Resource> & p_res, const String & p_property) Line 287	C++
 	godot.windows.tools.64.exe!InspectorDock::edit_resource(const Ref<Resource> & p_resource) Line 371	C++
 	godot.windows.tools.64.exe!EditorNode::load_resource(const String & p_resource, bool p_ignore_broken_deps) Line 756	C++
 	godot.windows.tools.64.exe!FileSystemDock::_select_file(const String & p_path, bool p_select_in_favorites) Line 837	C++
 	godot.windows.tools.64.exe!FileSystemDock::_file_list_activate_file(int p_idx) Line 857	C++
	godot.windows.tools.64.exe!MethodBind1<FileSystemDock,int>::call(Object * p_object, const Variant * * p_args, int p_arg_count, Variant::CallError & r_error) Line 867	C++
 	godot.windows.tools.64.exe!Object::call(const StringName & p_method, const Variant * * p_args, int p_argcount, Variant::CallError & r_error) Line 922	C++
 	godot.windows.tools.64.exe!Object::emit_signal(const StringName & p_name, const Variant * * p_args, int p_argcount) Line 1249	C++
 	godot.windows.tools.64.exe!Object::emit_signal(const StringName & p_name, const Variant & p_arg1, const Variant & p_arg2, const Variant & p_arg3, const Variant & p_arg4, const Variant & p_arg5) Line 1307	C++
 	godot.windows.tools.64.exe!ItemList::_gui_input(const Ref<InputEvent> & p_event) Line 570	C++
 	godot.windows.tools.64.exe!MethodBind1<ItemList,Ref<InputEvent> const &>::call(Object * p_object, const Variant * * p_args, int p_arg_count, Variant::CallError & r_error) Line 867	C++
 	godot.windows.tools.64.exe!Object::call_multilevel(const StringName & p_method, const Variant * * p_args, int p_argcount) Line 764	C++
 	godot.windows.tools.64.exe!Object::call_multilevel(const StringName & p_name, const Variant & p_arg1, const Variant & p_arg2, const Variant & p_arg3, const Variant & p_arg4, const Variant & p_arg5) Line 865	C++
 	godot.windows.tools.64.exe!Viewport::_gui_call_input(Control * p_control, const Ref<InputEvent> & p_input) Line 1669	C++
 	godot.windows.tools.64.exe!Viewport::_gui_input_event(Ref<InputEvent> p_event) Line 1979	C++
 	godot.windows.tools.64.exe!Viewport::input(const Ref<InputEvent> & p_event) Line 2828	C++
 	godot.windows.tools.64.exe!Viewport::_vp_input(const Ref<InputEvent> & p_ev) Line 1446	C++
 	godot.windows.tools.64.exe!MethodBind1<Viewport,Ref<InputEvent> const &>::call(Object * p_object, const Variant * * p_args, int p_arg_count, Variant::CallError & r_error) Line 867	C++
 	godot.windows.tools.64.exe!Object::call(const StringName & p_method, const Variant * * p_args, int p_argcount, Variant::CallError & r_error) Line 922	C++
 	godot.windows.tools.64.exe!Object::call(const StringName & p_name, const Variant & p_arg1, const Variant & p_arg2, const Variant & p_arg3, const Variant & p_arg4, const Variant & p_arg5) Line 848	C++
 	godot.windows.tools.64.exe!SceneTree::call_group_flags(unsigned int p_call_flags, const StringName & p_group, const StringName & p_function, const Variant & p_arg1, const Variant & p_arg2, const Variant & p_arg3, const Variant & p_arg4, const Variant & p_arg5) Line 275	C++
 	godot.windows.tools.64.exe!SceneTree::input_event(const Ref<InputEvent> & p_event) Line 431	C++
 	godot.windows.tools.64.exe!InputDefault::_parse_input_event_impl(const Ref<InputEvent> & p_event, bool p_is_emulated) Line 442	C++
 	godot.windows.tools.64.exe!InputDefault::parse_input_event(const Ref<InputEvent> & p_event) Line 260	C++
 	godot.windows.tools.64.exe!InputDefault::flush_accumulated_events() Line 679	C++
 	godot.windows.tools.64.exe!OS_Windows::process_events() Line 2607	C++
 	godot.windows.tools.64.exe!OS_Windows::run() Line 3404	C++
 	godot.windows.tools.64.exe!widechar_main(int argc, wchar_t * * argv) Line 162	C++
 	godot.windows.tools.64.exe!_main() Line 184	C++
 	godot.windows.tools.64.exe!main(int _argc, char * * _argv) Line 196	C++
```

**Steps to reproduce:**
Using the project below, open the GDScript from the file dock, and observe the error.

![godot windows tools 64_ajKkfKa80t](https://user-images.githubusercontent.com/13004169/87869847-cb8fa200-c9ab-11ea-8cac-f726fc2b061c.png)


The cause is the interaction of `can_handle(object)` in `EditorInspectorPlugin`, using code like the following:

```
extends Node

const TYPE = "Custom"

func is_class(p_name : String) -> bool:
	return p_name == TYPE or .is_class(p_name)

```

**Minimal reproduction project:**
<!-- A small Godot project which reproduces the issue. Drag and drop a zip archive to upload it. -->
[Editor Inspector Issue.zip](https://github.com/godotengine/godot/files/4943389/Editor.Inspector.Issue.zip)