Moved up check to see if 'repo' was valid before calling the lower() method on it.
Merge pull request #920 from wcerfgba/patch-1

Incorrect operation sequence in bzr-handling code