# HG changeset patch # User Ludovic Chabant # Date 1512016695 28800 # Node ID c4cfbbeed72e77d1bcd2f705ca2b903661129f75 # Parent fa489c5e829ebd4618ef605748404397abea3c59 chef: Fix crash for commands run outside of a website. diff -r fa489c5e829e -r c4cfbbeed72e piecrust/main.py --- a/piecrust/main.py Wed Nov 29 20:37:57 2017 -0800 +++ b/piecrust/main.py Wed Nov 29 20:38:15 2017 -0800 @@ -316,8 +316,9 @@ return 0 # Add some timing information. - app.env.stats.registerTimer('ChefStartup') - app.env.stats.stepTimerSince('ChefStartup', _chef_start_time) + if app.env: + app.env.stats.registerTimer('ChefStartup') + app.env.stats.stepTimerSince('ChefStartup', _chef_start_time) # Run the command! ctx = CommandContext(appfactory, app, parser, result)