Fixed NullPointerException when sending error

Potential null pointer exception, if error was introduced without
throwable as source.