[SYNCOPE-1362] Troublesome Optional
authorFrancesco Chicchiriccò <ilgrosso@apache.org>
Wed, 5 Sep 2018 06:36:41 +0000 (08:36 +0200)
committerFrancesco Chicchiriccò <ilgrosso@apache.org>
Wed, 5 Sep 2018 06:36:55 +0000 (08:36 +0200)
client/console/src/main/java/org/apache/syncope/client/console/commons/SortableAnyProviderComparator.java

index 9a5d86a..318963d 100644 (file)
@@ -83,20 +83,20 @@ public class SortableAnyProviderComparator<T extends AnyTO> extends SortableData
 
             final AttrTO attr;
             if (schemaType == null) {
-                attr = this.anyTO.getPlainAttr(schema).get();
+                attr = this.anyTO.getPlainAttr(schema).orElse(null);
             } else {
                 switch (schemaType) {
                     case PLAIN:
                     default:
-                        attr = this.anyTO.getPlainAttr(schema).get();
+                        attr = this.anyTO.getPlainAttr(schema).orElse(null);
                         break;
 
                     case DERIVED:
-                        attr = this.anyTO.getDerAttr(schema).get();
+                        attr = this.anyTO.getDerAttr(schema).orElse(null);
                         break;
 
                     case VIRTUAL:
-                        attr = this.anyTO.getVirAttr(schema).get();
+                        attr = this.anyTO.getVirAttr(schema).orElse(null);
                         break;
                 }
             }