diff options
| author | Omar Roth <omarroth@hotmail.com> | 2018-07-18 19:13:06 -0500 |
|---|---|---|
| committer | Omar Roth <omarroth@hotmail.com> | 2018-07-18 19:13:06 -0500 |
| commit | 68d5ee95b3075afb843c9332a7bb44c4b94dd4be (patch) | |
| tree | 05fbb84f1350431c4dec67259870494c97741a4e /src | |
| parent | abab7fca87ee053249e111383e1b591e6f04dfe5 (diff) | |
| download | invidious-68d5ee95b3075afb843c9332a7bb44c4b94dd4be.tar.gz invidious-68d5ee95b3075afb843c9332a7bb44c4b94dd4be.tar.bz2 invidious-68d5ee95b3075afb843c9332a7bb44c4b94dd4be.zip | |
Add fix for decoding invalid user preferences
Diffstat (limited to 'src')
| -rw-r--r-- | src/invidious/helpers.cr | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/invidious/helpers.cr b/src/invidious/helpers.cr index 5734aa3a..ad36cf4e 100644 --- a/src/invidious/helpers.cr +++ b/src/invidious/helpers.cr @@ -119,7 +119,11 @@ end class User module PreferencesConverter def self.from_rs(rs) - Preferences.from_json(rs.read(String)) + begin + Preferences.from_json(rs.read(String)) + rescue ex + DEFAULT_USER_PREFERENCES + end end end |
