diff options
| author | Bruce Hill <bruce@bruce-hill.com> | 2025-03-01 16:15:46 -0500 |
|---|---|---|
| committer | Bruce Hill <bruce@bruce-hill.com> | 2025-03-01 16:15:46 -0500 |
| commit | b0483e842973575a51bb3672acf5182ccd212763 (patch) | |
| tree | ba27f0aae43716a09fb72b410c5546953bb02ecc | |
| parent | fab0083129c134a49c77a4f7e3b333f1e0f14d55 (diff) | |
Check for null
| -rw-r--r-- | environment.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/environment.c b/environment.c index 393c0c30..f9b9a46f 100644 --- a/environment.c +++ b/environment.c @@ -697,6 +697,7 @@ binding_t *get_namespace_binding(env_t *env, ast_t *self, const char *name) PUREFUNC binding_t *get_constructor(env_t *env, type_t *t, arg_ast_t *args, type_t *constructed_type) { env_t *type_env = get_namespace_by_type(env, t); + if (!type_env) return NULL; Array_t constructors = type_env->namespace->constructors; // Prioritize exact matches: for (int64_t i = 0; i < constructors.length; i++) { |
