HHH-8238 OsgiJtaPlatform null pointer exception

This commit is contained in:
Brett Meyer 2013-05-16 11:46:04 -04:00
parent 08215bad73
commit 24f1a15d07
1 changed files with 2 additions and 2 deletions

View File

@ -54,13 +54,13 @@ public class OsgiJtaPlatform implements JtaPlatform {
@Override
public TransactionManager retrieveTransactionManager() {
final ServiceReference sr = bundleContext.getServiceReference( TransactionManager.class.getName() );
return (TransactionManager) bundleContext.getService( sr );
return sr == null ? null : (TransactionManager) bundleContext.getService( sr );
}
@Override
public UserTransaction retrieveUserTransaction() {
final ServiceReference sr = bundleContext.getServiceReference( UserTransaction.class.getName() );
return (UserTransaction) bundleContext.getService( sr );
return sr == null ? null : (UserTransaction) bundleContext.getService( sr );
}
@Override