Ignore:
Timestamp:
08/14/19 14:22:44 (5 years ago)
Author:
bln4
Message:

Fixed bug for when there are no surrogates left for a primary.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/expeditee/encryption/io/EncryptedExpWriter.java

    r1420 r1430  
    194194                Function<Item, Boolean> isTagInherited = surrogate -> surrogate.isTagInherited(tag + "");
    195195                BinaryOperator<Boolean> trueExists = (a, b) -> a || b;
    196                 boolean surrogatesInherit = surrogateItems.stream().map(isTagInherited).collect(Collectors.reducing(trueExists)).get();
     196                boolean surrogatesInherit = surrogateItems.stream().map(isTagInherited).collect(Collectors.reducing(trueExists)).orElseGet(() -> false);
    197197                boolean userHasKey = Label.getLabel(toWrite.getEncryptionLabel()) == LabelResult.SuccessResolveLabelToKey;
    198198               
    199                 // If we have no surrogates that inherit this property from us, and we have the label required to encrypt it, then we should entry it.
     199                // If we have no surrogates that inherit this property from us, and we have the label required to encrypt it, then we should encrypt it.
    200200                if (!surrogatesInherit && userHasKey) {
    201201                        EncryptionDetail reencryptOnSave = new EncryptionDetail(EncryptionDetail.Type.ReencryptOnSave);
Note: See TracChangeset for help on using the changeset viewer.