Bug 987383 - Make sure to deal with empty output so that JSON stay valid. r=
Merge pull request #18430 from hfiguiere/bug987383-2

Bug 987383 - Make sure to deal with empty output so that JSON stay valid r=julienw