Commit Graph

5 Commits

Author SHA1 Message Date
Engineer Smith
1feb208a35 Merge pull request #1 from rabbitboots/main
Add type-checks to getInfo, getDirectoryItems and getDirectoryItemsInfo
2022-02-28 22:23:37 +00:00
rabbitboots
5ca1313e85 Add type check to nativefs.getDirectoryItemsInfo()
Fixes coredump caused by passing nil to argument #1 of nativefs.getDirectoryItemsInfo().

Aside: An invalid arg #2 (filtertype) can slip by if the inner function doesn't iterate over any actual directory items.

Perhaps it would be better to type-check in withTempMount(), as that seems to be the source of the issue here and in getDirectoryItems().
2022-02-28 16:25:05 -04:00
rabbitboots
975de5de9e Add type check to nativefs.getDirectoryItems(dir)
Most incorrect types for 'dir' are caught deeper into the call stack, but passing nil causes a coredump. This type-check mirrors the behavior of love.filesystem.getDirectoryItems().
2022-02-28 15:56:17 -04:00
rabbitboots
d78b4f3246 Add type check to nativefs.getInfo()
Checks that argument #1 (path) is of type 'string'.
2022-02-28 13:06:52 -04:00
EngineerSmith
18805353c2 nativeFS @ dbfefa2 2022-01-19 21:22:21 +00:00