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 @@ -1311,16 +1311,22 @@ public void delete(String id) throws SpdxInvalidIdException {
13111311 }
13121312
13131313 /**
1314- * @param id
1314+ * @param id associated with a type
13151315 * @return Type typed value for the ID if it exists and is of an SPDX type, otherwise empty
13161316 * @throws InvalidSPDXAnalysisException
13171317 */
13181318 public Optional <TypedValue > getTypedValue (String id ) throws InvalidSPDXAnalysisException {
13191319 Objects .requireNonNull (id , "Missing required ID" );
1320+ if (!exists (id )) {
1321+ return Optional .empty ();
1322+ }
13201323 model .enterCriticalSection (false );
13211324 try {
13221325 try {
13231326 Resource idResource = idToResource (id );
1327+ if (!this .model .containsResource (idResource )) {
1328+ return Optional .empty ();
1329+ }
13241330 Resource idClass = idToClass (idResource );
13251331 if (Objects .isNull (idClass )) {
13261332 return Optional .empty ();
You can’t perform that action at this time.
0 commit comments