Fix NPE and update version.

This commit is contained in:
MikeAfc
2019-01-02 14:05:21 +08:00
parent 0fdd25b26c
commit 48da9302ea
3 changed files with 16 additions and 21 deletions
+1 -1
View File
@@ -46,7 +46,7 @@ org.gradle.jvmargs=-Xmx1536M
GROUP=com.alibaba.android
ARTIFACT=tangram
VERSION=1
VERSION_NAME=3.2.0.7
VERSION_NAME=3.2.0.8
PACKAGING_TYPE=aar
systemProp.compileSdkVersion=26
systemProp.targetSdkVersion=26
@@ -701,9 +701,9 @@ public class PojoDataParser extends DataParser<JSONObject, JSONArray> {
@NonNull ServiceManager serviceManager) {
BaseCell cell = null;
String cellType = parseCellType(cellData);
if ((resolver.resolver().getViewClass(cellType) != null) || Utils.isCard(cellData)) {
if ((resolver.resolver().getViewClass(cellType) != null) || Utils.isCard(cellType)) {
if (Utils.isCard(cellData)) {
if (Utils.isCard(cellType)) {
switch (cellType) {
case TangramBuilder.TYPE_CONTAINER_FLOW:
case TangramBuilder.TYPE_CONTAINER_1C_FLOW:
@@ -195,24 +195,19 @@ public class Utils {
return null;
}
public static boolean isCard(JSONObject cellData) {
if (cellData != null) {
String type = cellData.getString("type");
switch (type) {
case TangramBuilder.TYPE_CONTAINER_BANNER:
case TangramBuilder.TYPE_CONTAINER_SCROLL:
case TangramBuilder.TYPE_CONTAINER_FLOW:
case TangramBuilder.TYPE_CONTAINER_1C_FLOW:
case TangramBuilder.TYPE_CONTAINER_2C_FLOW:
case TangramBuilder.TYPE_CONTAINER_3C_FLOW:
case TangramBuilder.TYPE_CONTAINER_4C_FLOW:
case TangramBuilder.TYPE_CONTAINER_5C_FLOW:
return true;
default:
return false;
}
} else {
return false;
public static boolean isCard(String type) {
switch (type) {
case TangramBuilder.TYPE_CONTAINER_BANNER:
case TangramBuilder.TYPE_CONTAINER_SCROLL:
case TangramBuilder.TYPE_CONTAINER_FLOW:
case TangramBuilder.TYPE_CONTAINER_1C_FLOW:
case TangramBuilder.TYPE_CONTAINER_2C_FLOW:
case TangramBuilder.TYPE_CONTAINER_3C_FLOW:
case TangramBuilder.TYPE_CONTAINER_4C_FLOW:
case TangramBuilder.TYPE_CONTAINER_5C_FLOW:
return true;
default:
return false;
}
}