Skip to content

Commit 8c2a658

Browse files
committed
Allow null parameters in context checks
1 parent 45c2ab4 commit 8c2a658

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/main/java/com/sri/yices/Context.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -331,7 +331,7 @@ public int getModelInterpolant() {
331331

332332
// Since 2.6.4
333333
public Status checkWithAssumptions(Parameters params, int[] assumptions) {
334-
int code = Yices.checkContextWithAssumptions(ptr, params.getPtr(), assumptions);
334+
int code = Yices.checkContextWithAssumptions(ptr, params == null ? 0 : params.getPtr(), assumptions);
335335
if (code < 0) {
336336
throw new YicesException();
337337
}
@@ -340,7 +340,7 @@ public Status checkWithAssumptions(Parameters params, int[] assumptions) {
340340

341341
// Since 2.6.4
342342
public Status checkWithModel(Parameters params, Model model, int[] assumptions) {
343-
int code = Yices.checkContextWithModel(ptr, params.getPtr(), model.getPtr(), assumptions);
343+
int code = Yices.checkContextWithModel(ptr, params == null ? 0 : params.getPtr(), model.getPtr(), assumptions);
344344
if (code < 0) {
345345
YicesException error = YicesException.checkVersion(2, 6, 4);
346346
if (error == null) {

0 commit comments

Comments
 (0)