Skip to content

Commit 07ab96d

Browse files
committed
Also check if organ or term file is empty
Null-check is not enough for a string type and does not cover the case where the entry is set to empty in the configuration.
1 parent 9d8c051 commit 07ab96d

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/main/java/ubc/pavlab/rdp/services/GOServiceImpl.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ public void updateGoTerms() {
9696

9797
log.info( MessageFormat.format( "Loading GO terms from: {0}.", cacheSettings.getTermFile() ) );
9898

99-
if ( cacheSettings.getTermFile() == null ) {
99+
if ( cacheSettings.getTermFile() == null || cacheSettings.getTermFile().isEmpty() ) {
100100
log.warn( "No term file is defined, skipping update of GO terms." );
101101
return;
102102
}

src/main/java/ubc/pavlab/rdp/services/OrganInfoServiceImpl.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ public Collection<OrganInfo> findByActiveTrueOrderByOrdering() {
5252
public void updateOrganInfos() {
5353
try {
5454
Resource organFile = null;
55-
if ( applicationSettings.getCache().getOrganFile() != null ) {
55+
if ( applicationSettings.getCache().getOrganFile() != null || applicationSettings.getCache().getOrganFile().isEmpty() ) {
5656
organFile = resourceLoader.getResource( applicationSettings.getCache().getOrganFile() );
5757
}
5858
if ( organFile == null ) {

0 commit comments

Comments
 (0)