diff --git a/azurerm/resource_arm_application_gateway_test.go b/azurerm/resource_arm_application_gateway_test.go
index <HASH>..<HASH> 100644
--- a/azurerm/resource_arm_application_gateway_test.go
+++ b/azurerm/resource_arm_application_gateway_test.go
@@ -274,9 +274,11 @@ func testCheckAzureRMApplicationGatewayDestroy(s *terraform.State) error {
 		resp, err := conn.Get(resourceGroup, name)
 
 		if err != nil {
-			if !utils.ResponseWasNotFound(resp.Response) {
-				return err
+			if utils.ResponseWasNotFound(resp.Response) {
+				return nil
 			}
+
+			return err
 		}
 
 		return fmt.Errorf("App Gateway still exists:\n%#v", resp.ApplicationGatewayPropertiesFormat)
Returning nil when the app gateway doesn't exist