Check for filename string length > 0

Bad Access when filename exists with length 0, is checked now.