mirror of
				https://github.com/godotengine/godot.git
				synced 2025-10-31 13:41:03 +00:00 
			
		
		
		
	Merge pull request #22983 from Ashafix/master
Better error message for malformed plugins
This commit is contained in:
		
						commit
						998d3a30a5
					
				
					 1 changed files with 6 additions and 0 deletions
				
			
		|  | @ -2568,6 +2568,12 @@ void EditorNode::set_addon_plugin_enabled(const String &p_addon, bool p_enabled) | |||
| 		return; | ||||
| 	} | ||||
| 
 | ||||
| 	//errors in the script cause the base_type to be ""
 | ||||
| 	if (String(script->get_instance_base_type()) == "") { | ||||
| 		show_warning(vformat(TTR("Unable to load addon script from path: '%s' There seems to be an error in the code, please check the syntax."), path)); | ||||
| 		return; | ||||
| 	} | ||||
| 
 | ||||
| 	//could check inheritance..
 | ||||
| 	if (String(script->get_instance_base_type()) != "EditorPlugin") { | ||||
| 		show_warning(vformat(TTR("Unable to load addon script from path: '%s' Base type is not EditorPlugin."), path)); | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Max Hilbrunner
						Max Hilbrunner