diff options
author | George Marques <george@gmarqu.es> | 2024-05-02 15:06:07 -0300 |
---|---|---|
committer | George Marques <george@gmarqu.es> | 2024-05-02 15:09:22 -0300 |
commit | 22236380c033a1d441d9b35b4bc1529218d4e39d (patch) | |
tree | 8a380cf8d4b9b1af0a2330a03532ec1b9b68d874 /modules/gdscript/language_server/gdscript_extend_parser.cpp | |
parent | 06d105e268ace265809ae3fac2f17ccea9ff88dd (diff) | |
download | redot-engine-22236380c033a1d441d9b35b4bc1529218d4e39d.tar.gz |
GDScript: Initialize static variables with defaults in-editor
When the script is not marked as `@tool` the static constructor is not
called and thus the variables contain `null` by default. But since some
validated operations requires a valid value, this would cause a crash.
This commit solves this by initializing the static variables with a
default value based on their types in the editor, when they are not
marked as `@tool`, so if some `@tool` script access them, they will have
a valid typed value, avoiding the crash.
Diffstat (limited to 'modules/gdscript/language_server/gdscript_extend_parser.cpp')
0 files changed, 0 insertions, 0 deletions