import com.oransc.rappmanager.models.rapp.Rapp;
import java.util.Collection;
+import java.util.List;
import java.util.Map;
import java.util.Optional;
import lombok.RequiredArgsConstructor;
public Collection<Rapp> getAllRapp() {
Cache cache = cacheManager.getCache(RAPP_CACHE);
- Map<String, Rapp> nativeCache = (Map<String, Rapp>) cache.getNativeCache();
- return nativeCache.values();
+ if(cache != null) {
+ Map<String, Rapp> nativeCache = (Map<String, Rapp>) cache.getNativeCache();
+ return nativeCache.values();
+ }
+ return List.of();
}
public Optional<Rapp> getRapp(String rappId) {