Update app.py

Handle situation when Window is None (e.g. when App's build() returned nothing). Error message could be better, but it does the job.