# HG changeset patch # User Marcin Kuzminski # Date 2017-12-17 18:13:47 # Node ID 6bb32f7a099abba9461aa426f2760dcd0b3d7144 # Parent 02e39d962331b2acf57c5884be7b60c213d95ac9 hooks: use safer method of exporting the RC_SCM_DATA, prevents JSON decode errors in case of None value diff --git a/vcsserver/hooks.py b/vcsserver/hooks.py --- a/vcsserver/hooks.py +++ b/vcsserver/hooks.py @@ -136,7 +136,10 @@ def _extras_from_ui(ui): hook_data = ui.config('rhodecode', 'RC_SCM_DATA') if not hook_data: # maybe it's inside environ ? - hook_data = os.environ.get('RC_SCM_DATA') + env_hook_data = os.environ.get('RC_SCM_DATA') + if env_hook_data: + hook_data = env_hook_data + extras = json.loads(hook_data) return extras