Skip to content

Commit ab676c1

Browse files
committed
[logger] check and validate required crash parameters
1 parent 546b598 commit ab676c1

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

plugins/logger/api/api.js

+13-1
Original file line numberDiff line numberDiff line change
@@ -108,12 +108,24 @@ var plugin = {},
108108
if(types["crash"] && typeof types["crash"] == "object"){
109109
types["crash"] = JSON.stringify(types["crash"]);
110110
}
111+
var res;
111112
try{
112-
JSON.parse(types["crash"]);
113+
res = JSON.parse(types["crash"]);
113114
}
114115
catch(ex){
115116
problems.push("Could not parse crash");
116117
}
118+
if(res){
119+
if(!res._error){
120+
problems.push("Crash missing _error property");
121+
}
122+
if(!res._app_version){
123+
problems.push("Crash missing _app_version property");
124+
}
125+
if(!res._os && params.app.type !== "web"){
126+
problems.push("Crash missing _os property");
127+
}
128+
}
117129
}
118130

119131
if(params.app.type !== "web" && params.qstring.sdk_name === "javascript_native_web"){

0 commit comments

Comments
 (0)