[extensions-web] update-info: return empty response in case of broken input
- From: Yuri Konotopov <ykonotopov src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [extensions-web] update-info: return empty response in case of broken input
- Date: Thu, 9 Feb 2017 14:48:50 +0000 (UTC)
commit e55626a7b015fc3616761481cf6599040601fbb7
Author: Yuri Konotopov <ykonotopov gnome org>
Date: Thu Feb 9 18:48:31 2017 +0400
update-info: return empty response in case of broken input
sweettooth/extensions/views.py | 8 ++++++--
1 files changed, 6 insertions(+), 2 deletions(-)
---
diff --git a/sweettooth/extensions/views.py b/sweettooth/extensions/views.py
index da37e0f..16bd1f9 100644
--- a/sweettooth/extensions/views.py
+++ b/sweettooth/extensions/views.py
@@ -83,8 +83,12 @@ def shell_download(request, uuid):
@ajax_view
def shell_update(request):
- installed = json.loads(request.GET['installed'])
- shell_version = request.GET['shell_version']
+ try:
+ installed = json.loads(request.GET['installed'])
+ shell_version = request.GET['shell_version']
+ except (KeyError, ValueError):
+ return {}
+
operations = {}
for uuid, meta in installed.iteritems():
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]