File tree 1 file changed +9
-4
lines changed
src/main/java/org/ohdsi/webapi/shiro/filters
1 file changed +9
-4
lines changed Original file line number Diff line number Diff line change 16
16
import org .ohdsi .webapi .pathway .PathwayService ;
17
17
import org .ohdsi .webapi .service .IRAnalysisService ;
18
18
import org .ohdsi .webapi .shiro .PermissionManager ;
19
+ import org .ohdsi .webapi .shiro .exception .NullJsonNodeException ;
19
20
import org .ohdsi .webapi .shiro .exception .PermissionAlreadyExistsException ;
20
21
import org .slf4j .Logger ;
21
22
import org .slf4j .LoggerFactory ;
@@ -82,10 +83,14 @@ public void doProcessResponseContent(String content) throws Exception {
82
83
83
84
private Optional <EntityName > getParentEntity (String content ) throws IOException {
84
85
85
- String entityType = parseJsonField (content , "entityName" );
86
- return parentEntities .stream ()
87
- .filter (e -> e .toString ().equalsIgnoreCase (entityType ))
88
- .findFirst ();
86
+ try {
87
+ String entityType = parseJsonField (content , "entityName" );
88
+ return parentEntities .stream ()
89
+ .filter (e -> e .toString ().equalsIgnoreCase (entityType ))
90
+ .findFirst ();
91
+ } catch (NullJsonNodeException e ){
92
+ return Optional .empty ();
93
+ }
89
94
}
90
95
91
96
private void addPermissionsToNestedEntities (String content , EntityName parentEntityName ) throws IOException {
You can’t perform that action at this time.
0 commit comments