Make sure we abort loop when there isn't a basename
Make sure we abort loop when there isn't a basename

Closes #159.

dmoliveira/yapf,sbc100/yapf,google/yapf,lucius-feng/yapf,thurday/yapf,sbc100/yapf,abduld/yapf,bygloam/yapf,google/yapf,wklken/yapf,nikolamilosevic86/yapf,jamesblunt/yapf,elviswf/yapf,ambv/yapf,hayd/yapf