Fix type error when length applies to array not object
Merge pull request #252 from mohamedmansour/master

Fix type error when length applies to array not object