Skip to content

Commit

Permalink
Cover case where cid is empty
Browse files Browse the repository at this point in the history
  • Loading branch information
benjamin-confino authored and manovotn committed Feb 25, 2020
1 parent 6b6d640 commit 8d4fb65
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ protected void checkContextInitialized() {
throw e;
}
// new conversation, fire init event
if (cid == null) { // transient conversation
if (cid == null || cid.isEmpty()) { // transient conversation
fireInitEvent(request);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,5 +79,12 @@ public void testInitEventFired() throws IOException {
destroyedPage = client.getPage(url + "destroyed");
assertTrue(initPage.getContent().contains("init: 2"));
assertTrue(destroyedPage.getContent().contains("destroyed: 2"));

// get non-existing conversation wtih empty cid
client.getPage(url + "begin?cid=");
initPage = client.getPage(url + "init");
destroyedPage = client.getPage(url + "destroyed");
assertTrue(initPage.getContent().contains("init: 3"));
assertTrue(destroyedPage.getContent().contains("destroyed: 3"));
}
}

0 comments on commit 8d4fb65

Please sign in to comment.