Skip to content

Commit 0108159

Browse files
committed
Fix bug with DataObject.getBoolean method when database used is sql.
1 parent f23dcac commit 0108159

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

src/main/java/picoded/dstack/jsql/JSql_DataObjectMapUtil.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -264,15 +264,15 @@ protected static Object extractNonArrayValueFromPos(JSqlResult r, int pos) {
264264
// Boolean value support
265265
//
266266
if(baseType == Core_DataType.BOOLEAN.getValue()){
267-
String tVl = r.getString("tVl");
268-
if(tVl.equalsIgnoreCase("true")){
267+
String tVl = (r.get("tVl") != null) ? r.get("tVl").getString(pos) : null;
268+
if(tVl != null && tVl.equalsIgnoreCase("true")){
269269
return true;
270270
}
271-
if(tVl.equalsIgnoreCase("false")){
271+
if(tVl != null && tVl.equalsIgnoreCase("false")){
272272
return false;
273273
}
274274
// get the value from nVl
275-
int nVl = r.getInt("nVl");
275+
int nVl = (r.get("nVl") != null) ? r.get("nVl").getInt(pos) : -1;
276276
if(nVl == 1){
277277
return true;
278278
}

0 commit comments

Comments
 (0)