diff --git a/src/context.rs b/src/context.rs
index 1a2680021..2e703ac15 100644
--- a/src/context.rs
+++ b/src/context.rs
@@ -188,7 +188,7 @@ impl ActorHttpContext for HttpContext where A: Actor,
mem::transmute(self as &mut HttpContext)
};
- if self.inner.started() && self.inner.alive() {
+ if !self.inner.started() || self.inner.started() && self.inner.alive() {
match self.inner.poll(ctx) {
Ok(Async::NotReady) | Ok(Async::Ready(())) => (),
Err(_) => return Err(ErrorInternalServerError("error").into()),
diff --git a/src/ws/context.rs b/src/ws/context.rs
index 26aa5cb10..7040345fb 100644
--- a/src/ws/context.rs
+++ b/src/ws/context.rs
@@ -204,8 +204,9 @@ impl ActorHttpContext for WebsocketContext where A: Actor)
};
- if self.inner.started() && self.inner.alive() && self.inner.poll(ctx).is_err() {
- return Err(ErrorInternalServerError("error").into())
+ if (!self.inner.started() || self.inner.started() && self.inner.alive())
+ && self.inner.poll(ctx).is_err() {
+ return Err(ErrorInternalServerError("error").into())
}
// frames