Skip to content
This repository has been archived by the owner on Jan 29, 2024. It is now read-only.

Commit

Permalink
Fixed Null Pointer problem in RetailCustomerServiceImpl.
Browse files Browse the repository at this point in the history
  • Loading branch information
jateeter committed Feb 27, 2014
1 parent 4fc61a0 commit 4678619
Showing 1 changed file with 6 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -154,14 +154,16 @@ public Subscription associateByUUID(Long retailCustomerId, UUID uuid) {

try {
retailCustomer = resourceService.findById(retailCustomerId, RetailCustomer.class);

usagePoint = resourceService.findByUUID(uuid, UsagePoint.class);

if (usagePoint == null) {
try {

usagePoint = resourceService.findByUUID(uuid, UsagePoint.class);

} catch (Exception e) {

usagePoint = new UsagePoint();
usagePoint.setUUID(uuid);
usagePoint.setDescription("A Temporary UsagePoint Description");
usagePoint.setServiceCategory(new ServiceCategory(ServiceCategory.ELECTRICITY_SERVICE)) ;
resourceService.persist(usagePoint);

}
Expand Down

0 comments on commit 4678619

Please sign in to comment.