Raise RuntimeError when no project selected

Fixes #44