dhm116/restler — comment on commit 586b9f4fdc585a504f3b04fde8d08e37680cc726
File:  line 0
By dhm116:

No, it's not a rails bug. It's a bug in the restler JSON-handling code that is triggered by interacting with rails rest services. The restler code blows up if data is not null, but contains no useful data, so this is just a trivial fix to prevent that

Realistically, this should be left to the JSON decoder itself to determine if valid JSON was provided, but that obviously doesn't happen nicely. Another option would be to put the JSON.parse in a try/catch, which would handle a wider array of possible deserialization issues.