Skip to content
This repository was archived by the owner on Jun 12, 2022. It is now read-only.

Commit 87af05c

Browse files
committed
Add check for parts in a split virtual path
1 parent 34eb156 commit 87af05c

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

RequireResolver.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -365,6 +365,12 @@ std::optional<SourceNodePtr> RojoResolver::resolveRequireToSourceNode(const std:
365365
// TODO: this function is O(n*m) [n = depth of instance tree, m = width of instance tree]. Could we improve this?
366366

367367
auto pathParts = Luau::split(requirePath, '/');
368+
369+
if (pathParts.size() == 0)
370+
{
371+
return std::nullopt;
372+
}
373+
368374
SourceNodePtr currentNode = root;
369375

370376
auto it = ++pathParts.begin(); // Skip first element

0 commit comments

Comments
 (0)