From 0f36059eac155878f0a1ce514d9a93d12bddf122 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Alexis=20Laferri=C3=A8re?= Date: Wed, 18 Mar 2015 14:57:24 -0400 Subject: [PATCH] contrib/opportunity: prevent null receiver error MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Alexis Laferrière --- contrib/opportunity/src/opportunity_controller.nit | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/contrib/opportunity/src/opportunity_controller.nit b/contrib/opportunity/src/opportunity_controller.nit index f52f07d..fd9cd75 100644 --- a/contrib/opportunity/src/opportunity_controller.nit +++ b/contrib/opportunity/src/opportunity_controller.nit @@ -199,9 +199,9 @@ class OpportunityMeetupREST if args.has("new_pers") then var name = request.string_arg("persname") var m_id = request.string_arg("meetup_id") - var ans = request.string_arg("answers").split("&") - if name == null or m_id == null then return bad_req - print ans + var ans_str = request.string_arg("answers") + if name == null or m_id == null or ans_str == null then return bad_req + var ans = ans_str.split("&") var ansmap = new HashMap[Int, Int] for i in ans do var mp = i.split("=") -- 1.7.9.5