Skip to content
This repository was archived by the owner on Jun 12, 2021. It is now read-only.

Commit 759ab7a

Browse files
committed
Deal with nothing being there.
1 parent 7cee421 commit 759ab7a

1 file changed

Lines changed: 7 additions & 3 deletions

File tree

src/oidcservice/state_interface.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -203,15 +203,19 @@ def multiple_extend_request_args(self, args, key, parameters, item_types,
203203

204204
def store_X2state(self, x, state, xtyp):
205205
"""
206-
Store the connection between some value and a state value.
207-
This allows us later in the game to find the state if we have the nonce.
206+
Store the connection between some value (x) and a state value.
207+
This allows us later in the game to find the state if we have x.
208208
209209
:param x: The value of x
210210
:param state: The state value
211211
:param xtyp: The type of value x is (e.g. nonce, ...)
212212
"""
213213
self.state_db.set(KEY_PATTERN[xtyp].format(x), state)
214-
_val = self.state_db.get("ref{}ref".format(state))
214+
try:
215+
_val = self.state_db.get("ref{}ref".format(state))
216+
except KeyError:
217+
_val = None
218+
215219
if _val is None:
216220
refs = {xtyp:x}
217221
else:

0 commit comments

Comments
 (0)