Skip to content

Commit

Permalink
#82: return null if key is not present
Browse files Browse the repository at this point in the history
  • Loading branch information
Tiliavir committed Aug 21, 2022
1 parent c786aaa commit 6082c5e
Showing 1 changed file with 6 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package com.baloise.confluence.digitalsignature;

import com.atlassian.bandana.BandanaManager;
import com.google.common.collect.Sets;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import lombok.Getter;
Expand Down Expand Up @@ -51,6 +52,11 @@ static Signature deserialize(String serialization) {
}

public static Signature fromBandana(BandanaManager mgr, String key) {
if (mgr.getKeys(GLOBAL_CONTEXT) == null
|| !Sets.newHashSet(mgr.getKeys(GLOBAL_CONTEXT)).contains(key)) {
return null;
}

Object value = mgr.getValue(GLOBAL_CONTEXT, key);

if (value == null) {
Expand Down

0 comments on commit 6082c5e

Please sign in to comment.