From 0fae904f1c837a059321fdeb7660b6ab606fa567 Mon Sep 17 00:00:00 2001
From: Pagan Gazzard <pjgazzard@googlemail.com>
Date: Fri, 8 Aug 2014 10:56:51 +0100
Subject: [PATCH] Make sure to use string comparisons for the status code, to
 avoid issues where the types are different.

---
 src/application.coffee | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/src/application.coffee b/src/application.coffee
index 546688cc..e4946a2e 100644
--- a/src/application.coffee
+++ b/src/application.coffee
@@ -54,11 +54,13 @@ exports.kill = kill = (app) ->
 				.then ->
 					container.removeAsync()
 				.catch (err) ->
+					# Make sure statusCode is definitely a string, for comparison reasons.
+					statusCode = '' + err.statusCode
 					# 304 means the container was already stopped - so we can just remove it
-					if err.statusCode is 304
+					if statusCode is '304'
 						return container.removeAsync()
 					# 404 means the container doesn't exist, precisely what we want! :D
-					if err is 404
+					if statusCode is '404'
 						return
 					throw err
 		)