Check if size is set

Fixes 'Undefined index: size' when size is not set (on a directory for example)
Merge pull request #332 from barryvdh/patch-1

Check if size is set