summaryrefslogtreecommitdiffstats
path: root/modules/mono/csharp_script.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'modules/mono/csharp_script.cpp')
-rw-r--r--modules/mono/csharp_script.cpp14
1 files changed, 8 insertions, 6 deletions
diff --git a/modules/mono/csharp_script.cpp b/modules/mono/csharp_script.cpp
index 43d2779e41..932e97c46b 100644
--- a/modules/mono/csharp_script.cpp
+++ b/modules/mono/csharp_script.cpp
@@ -58,6 +58,7 @@
#include "godotsharp_dirs.h"
#include "managed_callable.h"
#include "mono_gd/gd_mono_cache.h"
+#include "servers/text_server.h"
#include "signal_awaiter_utils.h"
#include "utils/macros.h"
#include "utils/naming_utils.h"
@@ -92,11 +93,6 @@ String CSharpLanguage::get_extension() const {
return "cs";
}
-Error CSharpLanguage::execute_file(const String &p_path) {
- // ??
- return OK;
-}
-
void CSharpLanguage::init() {
#ifdef DEBUG_METHODS_ENABLED
if (OS::get_singleton()->get_cmdline_args().find("--class-db-json")) {
@@ -379,6 +375,10 @@ String CSharpLanguage::validate_path(const String &p_path) const {
if (keywords.find(class_name)) {
return RTR("Class name can't be a reserved keyword");
}
+ if (!TS->is_valid_identifier(class_name)) {
+ return RTR("Class name must be a valid identifier");
+ }
+
return "";
}
@@ -594,7 +594,7 @@ Vector<ScriptLanguage::StackInfo> CSharpLanguage::debug_get_current_stack_info()
_recursion_flag_ = false;
};
- if (!gdmono->is_runtime_initialized()) {
+ if (!gdmono || !gdmono->is_runtime_initialized()) {
return Vector<StackInfo>();
}
@@ -684,6 +684,7 @@ void CSharpLanguage::reload_tool_script(const Ref<Script> &p_script, bool p_soft
#ifdef GD_MONO_HOT_RELOAD
bool CSharpLanguage::is_assembly_reloading_needed() {
+ ERR_FAIL_NULL_V(gdmono, false);
if (!gdmono->is_runtime_initialized()) {
return false;
}
@@ -718,6 +719,7 @@ bool CSharpLanguage::is_assembly_reloading_needed() {
}
void CSharpLanguage::reload_assemblies(bool p_soft_reload) {
+ ERR_FAIL_NULL(gdmono);
if (!gdmono->is_runtime_initialized()) {
return;
}