On one of my catalogs, folder:getChildren() is returning 0 return values for a particular folder (that is, it is executing a "return;" statement, with no value): I've optimized the catalog to no effect.
If I hide the root folder "/", then the method works correctly.
I couldn't reproduce this problem. I actually did think I saw the behavior once, but then I could not reproduce so I think I may have just had a bug in my test code.
Can you try breaking out the calls into multiple lines like this:
local root = catalog:getFolders()[1]
local rootName = root:getName()
local subFolder = root:getChildren()[1]
local subFolderName = subFolder:getName()
local subSubFolder = subFolder:getChildren()[1]
local subSubFolderName = subSubFolder:getName()
and let me know if you still are seeing an issue...?
With the root folder "/" showing, the expression subFolder:getChildren()[1] gets "attempt to index a nil value". Here's the log from my debugger session showing each of the assignments and resulting value: