Make sure we actually have a type associated with the resourceId or we get an exception

This commit is contained in:
David Conlan 2017-10-17 15:07:51 +10:00
parent 8b7723b6e8
commit 1a7e43d2a8
1 changed files with 1 additions and 1 deletions

View File

@ -225,7 +225,7 @@ class RuleImplOp extends BaseRule /* implements IAuthRule */ {
return null;
}
}
if (appliesToResourceId != null) {
if (appliesToResourceId != null && appliesToResourceId.hasResourceType()) {
Class<? extends IBaseResource> type = theRequestDetails.getServer().getFhirContext().getResourceDefinition(appliesToResourceId.getResourceType()).getImplementingClass();
if (myAppliesToTypes.contains(type) == false) {
return null;