mirror of
https://github.com/eclipse-sailing-analytics/sailing-analytics.git
synced 2026-10-02 18:33:54 +00:00
avoid NPE when trying to find file storage mgmt service
This commit is contained in:
1 parent
88a21efc5e
commit
fdb38874bd
2 files changed
+7
No files matched your search
@@ -583,5 +583,8 @@ public interface RacingEventService extends TrackedRegattaRegistry, RegattaFetch
|
||||
*/
|
||||
FileStorageService getActiveFileStorageService() throws NoCorrespondingServiceRegisteredException;
|
||||
|
||||
/**
|
||||
* @return {@code null} if no service can be found in the OSGi registry
|
||||
*/
|
||||
FileStorageManagementService getFileStorageManagementService();
|
||||
}
|
||||
+4
@@ -3001,6 +3001,10 @@ public class RacingEventServiceImpl implements RacingEventService, ClearStateTes
|
||||
public FileStorageManagementService getFileStorageManagementService() {
|
||||
ServiceReference<FileStorageManagementService> ref = bundleContext
|
||||
.getServiceReference(FileStorageManagementService.class);
|
||||
if (ref == null) {
|
||||
logger.warning("No file storage management service registered");
|
||||
return null;
|
||||
}
|
||||
return bundleContext.getService(ref);
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user