Check that pending assets are an array when compiling

This PR checks that the pending assets are an Array.
If a collection is added via "$collection->requireDirectory" but the directory is empty, then the compiler throws an error.