diff --git a/molgenis-fair/src/main/java/org/molgenis/fair/controller/FairController.java b/molgenis-fair/src/main/java/org/molgenis/fair/controller/FairController.java
index <HASH>..<HASH> 100644
--- a/molgenis-fair/src/main/java/org/molgenis/fair/controller/FairController.java
+++ b/molgenis-fair/src/main/java/org/molgenis/fair/controller/FairController.java
@@ -75,6 +75,10 @@ public class FairController
 	{
 		String subjectIRI = getBaseUri().pathSegment(catalogID, datasetID).toUriString();
 		Entity subjectEntity = dataService.findOneById("fdp_Dataset", datasetID);
+		if (subjectEntity == null)
+		{
+			throw new UnknownEntityException("fdp_Dataset", datasetID);
+		}
 		return entityModelWriter.createRdfModel(subjectIRI, subjectEntity);
 	}
Fix: throw UnknownEntityException when dataset does not exist