Skip to content

Commit

Permalink
fix: protect against empty dates returned by clip searches
Browse files Browse the repository at this point in the history
  • Loading branch information
sparkpunkd committed Aug 16, 2019
1 parent ee663c1 commit 4d64d4b
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/cxx/clip.cc
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,11 @@ void searchClipsComplete(napi_env env, napi_status asyncStatus, void* data) {
}
REJECT_STATUS;
} else if ((key == "Completed") || (key == "Created")) {
c->status = convertToDate(env, value, &prop);
if (value.length() == 0) {
c->status = napi_get_null(env, &prop);
} else {
c->status = convertToDate(env, value, &prop);
}
REJECT_STATUS;
} else {
c->status = napi_create_string_utf8(env, value.c_str(), NAPI_AUTO_LENGTH, &prop);
Expand Down

0 comments on commit 4d64d4b

Please sign in to comment.