Skip to content

Commit fa0aede

Browse files
committed
Merge pull request #45 from mikeage/master
Handle StopIteration when the default workspace has no projects
2 parents 00168a0 + 2970c49 commit fa0aede

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

pyral/context.py

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -302,10 +302,13 @@ def _getDefaults(self, response):
302302
## print projects.content
303303
##
304304
if projects:
305-
proj = projects.next()
306-
proj_ref = proj._ref
307-
self._defaultProject = proj.Name
308-
self._currentProject = proj.Name
305+
try:
306+
proj = projects.next()
307+
proj_ref = proj._ref
308+
self._defaultProject = proj.Name
309+
self._currentProject = proj.Name
310+
except StopIteration: # The default workspace might not have any projects
311+
pass
309312
##
310313
## print " Default Workspace : %s" % self._defaultWorkspace
311314
## print " Default Project : %s" % self._defaultProject

0 commit comments

Comments
 (0)