File tree Expand file tree Collapse file tree
src/main/java/org/spdx/spdxRdfStore Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -1286,16 +1286,22 @@ public void delete(String id) throws SpdxInvalidIdException {
12861286 }
12871287
12881288 /**
1289- * @param id
1289+ * @param id associated with a type
12901290 * @return Type typed value for the ID if it exists and is of an SPDX type, otherwise empty
12911291 * @throws InvalidSPDXAnalysisException
12921292 */
12931293 public Optional <TypedValue > getTypedValue (String id ) throws InvalidSPDXAnalysisException {
12941294 Objects .requireNonNull (id , "Missing required ID" );
1295+ if (!exists (id )) {
1296+ return Optional .empty ();
1297+ }
12951298 model .enterCriticalSection (false );
12961299 try {
12971300 try {
12981301 Resource idResource = idToResource (id );
1302+ if (!this .model .containsResource (idResource )) {
1303+ return Optional .empty ();
1304+ }
12991305 Resource idClass = idToClass (idResource );
13001306 if (Objects .isNull (idClass )) {
13011307 return Optional .empty ();
You can’t perform that action at this time.
0 commit comments