Null check for ClientResponse in PolicyUril.java
[portal.git] / ecomp-portal-BE-common / src / main / java / org / openecomp / portalapp / portal / scheduler / policy / PolicyUtil.java
index aa4216b..3e1c941 100644 (file)
@@ -66,10 +66,13 @@ public class PolicyUtil {
        
        public static PolicyResponseWrapper wrapResponse (ClientResponse cres) {        
                String resp_str = "";
+               int statuscode = 0;
                if ( cres != null ) {
                        resp_str = cres.readEntity(String.class);
+                       statuscode = cres.getStatus();
                }
-               int statuscode = cres.getStatus();
+               
+               
                PolicyResponseWrapper w = PolicyUtil.wrapResponse ( resp_str, statuscode );
                return (w);
        }