It appears the code is checking for a subdir property that does not exist. Instead there is a content type of 'application/directory'