Skip to content

Commit 233582f

Browse files
committed
Merge pull request livecode#3524 from peter-b/js/check-env-null
[emscripten] Only import environment array if non-null.
2 parents 47f23b0 + 9474c44 commit 233582f

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

engine/src/em-main.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ platform_main(int argc, char *argv[], char *envp[])
9191
/* ---------- Process the environment */
9292
/* Count env variables */
9393
int t_envc;
94-
for (t_envc = 0; envp[t_envc] != nil; ++t_envc);
94+
for (t_envc = 0; envp != nil && envp[t_envc] != nil; ++t_envc);
9595

9696
/* Import. Note that the envp array is null-terminated */
9797
MCStringRef *t_envp;

0 commit comments

Comments
 (0)