jsonObject = {"mmbRetrieveBookingResponse":{"bookingData":null,"isAfterTransactionFromSb":false,"isAllFlightsCancelled":false,"isSuccess":false}}
如图所示的json,取出bookingData判断为null的问题
if(jsonObject.get("bookingData") == null || "null".equals(jsonObject.get("bookingData")) || isEmpty等判断都为true)
直接getJsonObject ,由于bookingData为null会报错
用jsonObject.isNull(“bookingData”)可正确判断;
赶项目,匆忙记录,请忽略格式混乱
盛世岂埋凌云气,年少无为就努力