mirror of
https://github.com/owntracks/recorder.git
synced 2026-08-27 16:57:21 +00:00
protect against missing tst in JSON
This commit is contained in:
@@ -35,6 +35,11 @@ static double cmp(JsonNode * a, JsonNode * b)
|
||||
JsonNode *tb = json_find_member(b, "tst");
|
||||
//printf("a=%lf, b=%lf\n", ta->number_, tb->number_);
|
||||
|
||||
/* user may have chosen fields without tst */
|
||||
|
||||
if (!ta || !tb)
|
||||
return (0.0);
|
||||
|
||||
return ta->number_ - tb->number_;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user