The function changes from forEach to for...of, but then returns early from within the loop body. The early return will exit the entire function, not just the loop iteration. This is likely a bug - the original forEach would have continued to check other environment variables. If an early exit is intended for the first missing variable, this works correctly, but verify this is the desired behavior.
Originally posted by @Copilot in #431
