Skip to content

Commit

Permalink
NullPointerException inside LibraryContentProvider breaks the compile…
Browse files Browse the repository at this point in the history
…r's workflow (#1567)

* Fixing obscure NullPointerException when loading and compiling dependent libraries of a library. The LibraryContentProvider must return null if the library isn't found (as opposed to triggering an NPE) to allow next providers to continue the process.

* Spotless check
  • Loading branch information
vitorpamplona authored Sep 1, 2022
1 parent 9e43cce commit 3a58914
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2021 Google LLC
* Copyright 2022 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand All @@ -26,7 +26,7 @@ class FhirEngineLibraryContentProvider(adapterFactory: AdapterFactory) :
BaseFhirLibraryContentProvider(adapterFactory) {
val libs = mutableMapOf<String, Library>()

override fun getLibrary(libraryIdentifier: VersionedIdentifier): IBaseResource {
return libs[libraryIdentifier.id]!!
override fun getLibrary(libraryIdentifier: VersionedIdentifier): IBaseResource? {
return libs[libraryIdentifier.id]
}
}

0 comments on commit 3a58914

Please sign in to comment.