File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed
hibernate-osgi/src/main/java/org/hibernate/osgi Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -49,14 +49,14 @@ public OsgiJtaPlatform(BundleContext bundleContext) {
49
49
50
50
@ Override
51
51
public TransactionManager retrieveTransactionManager () {
52
- ServiceReference sr = bundleContext .getServiceReference ( TransactionManager .class .getName () );
53
- return (TransactionManager ) bundleContext .getService ( sr );
52
+ final ServiceReference sr = bundleContext .getServiceReference ( TransactionManager .class .getName () );
53
+ return sr == null ? null : (TransactionManager ) bundleContext .getService ( sr );
54
54
}
55
55
56
56
@ Override
57
57
public UserTransaction retrieveUserTransaction () {
58
- ServiceReference sr = bundleContext .getServiceReference ( UserTransaction .class .getName () );
59
- return (UserTransaction ) bundleContext .getService ( sr );
58
+ final ServiceReference sr = bundleContext .getServiceReference ( UserTransaction .class .getName () );
59
+ return sr == null ? null : (UserTransaction ) bundleContext .getService ( sr );
60
60
}
61
61
62
62
@ Override
You can’t perform that action at this time.
0 commit comments