Skip to content

Commit

Permalink
Fix bug in TreeRpc where the "delete_all" field may be null.
Browse files Browse the repository at this point in the history
Fixed TestTreeRpc delete definition unit test

Signed-off-by: Chris Larsen <clarsen@euphoriaaudio.com>
  • Loading branch information
manolama committed Sep 26, 2013
1 parent 203679b commit 4ad0659
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/tsd/TreeRpc.java
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ private void handleTree() {
}
} else {
final String delete_all = query.getQueryStringParam("definition");
if (delete_all.toLowerCase().equals("true")) {
if (delete_all != null && delete_all.toLowerCase().equals("true")) {
delete_definition = true;
}
}
Expand Down
2 changes: 1 addition & 1 deletion test/tsd/TestTreeRpc.java
Original file line number Diff line number Diff line change
Expand Up @@ -363,7 +363,7 @@ public void handleTreePOSTDeleteDefault() throws Exception {
public void handleTreePOSTDeleteDefinition() throws Exception {
setupStorage();
HttpQuery query = NettyMocks.deleteQuery(tsdb,
"/api/tree?definition=true", "{\"treeId\":1}");
"/api/tree", "{\"treeId\":1,\"definition\":true}");
// make sure the root is there BEFORE we delete
assertEquals(4, storage.numColumns(new byte[] { 0, 1 }));
rpc.execute(tsdb, query);
Expand Down

0 comments on commit 4ad0659

Please sign in to comment.