changeset 557:703ea5d76f33

serve: Don't crash when looking at the debug info in a stand-alone window.
author Ludovic Chabant <ludovic@chabant.com>
date Wed, 12 Aug 2015 23:20:16 -0700
parents 93b656f0af54
children 9ab005db2592
files piecrust/data/provider.py
diffstat 1 files changed, 2 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/piecrust/data/provider.py	Wed Aug 12 23:18:35 2015 -0700
+++ b/piecrust/data/provider.py	Wed Aug 12 23:20:16 2015 -0700
@@ -178,7 +178,8 @@
     def _onIteration(self):
         if not self._ctx_set:
             eis = self._page.app.env.exec_info_stack
-            eis.current_page_info.render_ctx.addUsedSource(self._source)
+            if eis.current_page_info:
+                eis.current_page_info.render_ctx.addUsedSource(self._source)
             self._ctx_set = True