Bug 889830 - JavascriptException: TypeError: result[i].type r=etienne

see  https://bugzilla.mozilla.org/show_bug.cgi?id=889830 , https://github.com/mozilla-b2g/gaia/pull/17308/files#r10788992