c9 / architect

A simple yet powerful plugin system for large-scale node applications
MIT License
982 stars 129 forks source link

fix exit condition in loop, to prevent infinite loop #70

Closed greuze closed 2 years ago

greuze commented 5 years ago

When trying lo load a module synchronously, and that module doesn't exist, the loader stalls in an infinite loop, as base is never undefined, null or "", even when we try to go one level higher from root. When loading the module asynchronously, the code works, as is used / as exit condition here, instead of an empty path.

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

Fixes #27, that happens again as changes in #43 were reverted in #55