Skip to content

Commit

Permalink
fixed null context.getDbOperationResult().getNewData()
Browse files Browse the repository at this point in the history
  • Loading branch information
ujibang committed Jun 4, 2018
1 parent 4dddada commit 56eb273
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
4 changes: 2 additions & 2 deletions src/main/java/org/restheart/db/DAOUtils.java
Expand Up @@ -61,10 +61,10 @@ public class DAOUtils {
public final static Logger LOGGER = LoggerFactory.getLogger(DAOUtils.class);

public final static FindOneAndUpdateOptions FAU_UPSERT_OPS = new FindOneAndUpdateOptions()
.upsert(true);
.upsert(true).returnDocument(ReturnDocument.AFTER);

public final static FindOneAndUpdateOptions FAU_NOT_UPSERT_OPS = new FindOneAndUpdateOptions()
.upsert(false);
.upsert(false).returnDocument(ReturnDocument.AFTER);

public final static FindOneAndUpdateOptions FOU_AFTER_UPSERT_OPS = new FindOneAndUpdateOptions()
.upsert(true).returnDocument(ReturnDocument.AFTER);
Expand Down
Expand Up @@ -185,8 +185,6 @@ private boolean applyChecker(HttpServerExchange exchange,
if (doesCheckersApply(context, checker)
&& checker.doesSupportRequests(context)) {

BsonValue content = context.getContent();

BsonValue _data;

if (checker.getPhase(context)
Expand All @@ -208,7 +206,7 @@ private boolean applyChecker(HttpServerExchange exchange,
_data.asDocument(),
args,
confArgs);
} else if (content.isArray()) {
} else if (_data.isArray()) {
// content can be an array of bulk POST

BsonArray arrayContent = _data.asArray();
Expand Down

0 comments on commit 56eb273

Please sign in to comment.