diff --git a/app/src/main/java/com/gh/common/util/LogUtils.java b/app/src/main/java/com/gh/common/util/LogUtils.java index 4162058e53..1e426c5f79 100644 --- a/app/src/main/java/com/gh/common/util/LogUtils.java +++ b/app/src/main/java/com/gh/common/util/LogUtils.java @@ -39,13 +39,17 @@ public class LogUtils { object.put("article_name", articleTitle); object.put("tracers", tracers); object.put("read", readTime); + JSONObject columnObject = new JSONObject(); if (specialColumn != null) { - JSONObject columnObject = new JSONObject(); columnObject.put("type", specialColumn.getType()); columnObject.put("name", specialColumn.getName()); columnObject.put("tab", specialColumn.getTab()); - object.put("special_column", columnObject); + } else { + columnObject.put("type", ""); + columnObject.put("name", ""); + columnObject.put("tab", ""); } + object.put("special_column", columnObject); } catch (JSONException e) { e.printStackTrace(); } @@ -85,13 +89,17 @@ public class LogUtils { object.put("tracers", tracers); object.put("answer_id", answerId); object.put("read", readTime); + JSONObject columnObject = new JSONObject(); if (specialColumn != null) { - JSONObject columnObject = new JSONObject(); columnObject.put("type", specialColumn.getType()); columnObject.put("name", specialColumn.getName()); columnObject.put("tab", specialColumn.getTab()); - object.put("special_column", columnObject); + } else { + columnObject.put("type", ""); + columnObject.put("name", ""); + columnObject.put("tab", ""); } + object.put("special_column", columnObject); } catch (JSONException e) { e.printStackTrace(); } @@ -114,13 +122,17 @@ public class LogUtils { object.put("question_name", questions.getTitle()); object.put("tracers", tracers); object.put("read", readTime); + JSONObject columnObject = new JSONObject(); if (specialColumn != null) { - JSONObject columnObject = new JSONObject(); columnObject.put("type", specialColumn.getType()); columnObject.put("name", specialColumn.getName()); columnObject.put("tab", specialColumn.getTab()); - object.put("special_column", columnObject); + } else { + columnObject.put("type", ""); + columnObject.put("name", ""); + columnObject.put("tab", ""); } + object.put("special_column", columnObject); } catch (JSONException e) { e.printStackTrace(); }