|
|
@@ -552,11 +552,11 @@ public class ProductServiceImpl implements ProductService {
|
|
|
// 获取品牌
|
|
|
String brandUrl = urlProperties.getB2cUrl() + "/api/product/brand/byName/brand?name=" + brand;
|
|
|
BrandInfo brandInfo = restTemplate.getForEntity(brandUrl, BrandInfo.class).getBody();
|
|
|
- if (brandInfo.getUuid() != null) {
|
|
|
+ if (null != brandInfo && null != brandInfo.getUuid()) {
|
|
|
String componentUrl = urlProperties.getB2cUrl() + "/api/product/component/codeAndBrand/info?brandId="
|
|
|
+ brandInfo.getId() + "&cmpCode=" + cmpCode;
|
|
|
ComponentInfo component = restTemplate.getForEntity(componentUrl, ComponentInfo.class).getBody();
|
|
|
- if (null != component.getKind()) {
|
|
|
+ if (null != component && null != component.getKind()) {
|
|
|
kind = component.getKind().getNameCn();
|
|
|
}
|
|
|
}
|