What's the value of `$context` when the error occurs? I fail to see how this condition can help as if not passed, the context is an empty array.