Use os.walk() for project directories traversal. It is more standard.
Fixed None reference, when there is no active view.