Check for missing project before checking key

This commit is contained in:
John Lees-Miller 2016-06-03 16:11:31 +01:00
parent 1ac07526dc
commit 42d1236063

View file

@ -78,7 +78,12 @@ public class PostbackManager {
public void checkPostbackKey(String projectName, String postbackKey)
throws InvalidPostbackKeyException {
postbackContentsTable.get(projectName).checkPostbackKey(postbackKey);
PostbackPromise postbackPromise = postbackContentsTable.get(projectName);
if (postbackPromise == null) {
throw new InvalidPostbackKeyException(); // project not found; can't check key
} else {
postbackPromise.checkPostbackKey(postbackKey);
}
}
private String randomString() {