From: Alexis Laferrière Date: Wed, 18 Mar 2015 18:57:24 +0000 (-0400) Subject: contrib/opportunity: prevent null receiver error X-Git-Tag: v0.7.3~20^2 X-Git-Url: http://nitlanguage.org contrib/opportunity: prevent null receiver error Signed-off-by: Alexis Laferrière --- 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("=")