Fix bug when UJS returns None for error