Commit 3d80798
committed
Handle nil expiration_time_millis
`data.fetch("expiration_time_millis", 0)` will default to 0 only if the key is not present. If the key is present but the associated value is nil, then prior to this change the code would raise as follows:
```
NoMethodError (undefined method `/' for nil:NilClass
expires_at: data.fetch("expiration_time_millis", 0) / 1000
^):
```
This commit updates the code to default to 0 if the key is not found or if the value is nil.
With the existing token stores, this situation may not arise, but it's a particular issue when using a custom token store where values could be nil, like a database.1 parent a59a1df commit 3d80798
1 file changed
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
156 | 156 | | |
157 | 157 | | |
158 | 158 | | |
159 | | - | |
| 159 | + | |
160 | 160 | | |
161 | 161 | | |
162 | 162 | | |
| |||
0 commit comments