Check that env is not None before decrypting

After database migration 056, it became possible to have an environment
of None.  Check that env is not None before looking inside it.

Change-Id: Ic498e8e630608886178df83d1e7a503525834573
Closes-Bug: #1464379
This commit is contained in:
Jason Dunsmore 2015-06-11 15:01:52 -05:00
parent b5483ae07a
commit b6f865fa00
1 changed files with 2 additions and 1 deletions

View File

@ -47,7 +47,8 @@ class RawTemplate(
tpl[field] = db_tpl[field] tpl[field] = db_tpl[field]
# If any of the parameters were encrypted, then decrypt them # If any of the parameters were encrypted, then decrypt them
if env_fmt.ENCRYPTED_PARAM_NAMES in tpl.environment: if (tpl.environment is not None and
env_fmt.ENCRYPTED_PARAM_NAMES in tpl.environment):
parameters = tpl.environment[env_fmt.PARAMETERS] parameters = tpl.environment[env_fmt.PARAMETERS]
encrypted_param_names = tpl.environment[ encrypted_param_names = tpl.environment[
env_fmt.ENCRYPTED_PARAM_NAMES] env_fmt.ENCRYPTED_PARAM_NAMES]