@@ -344,7 +344,7 @@ core_v1_event_t *core_v1_event_parseFromJSON(cJSON *core_v1_eventJSON){
344
344
// core_v1_event->event_time
345
345
cJSON * event_time = cJSON_GetObjectItemCaseSensitive (core_v1_eventJSON , "eventTime" );
346
346
if (event_time ) {
347
- if (!cJSON_IsString (event_time ))
347
+ if (!cJSON_IsString (event_time ) && ! cJSON_IsNull ( event_time ) )
348
348
{
349
349
goto end ; //DateTime
350
350
}
@@ -353,7 +353,7 @@ core_v1_event_t *core_v1_event_parseFromJSON(cJSON *core_v1_eventJSON){
353
353
// core_v1_event->first_timestamp
354
354
cJSON * first_timestamp = cJSON_GetObjectItemCaseSensitive (core_v1_eventJSON , "firstTimestamp" );
355
355
if (first_timestamp ) {
356
- if (!cJSON_IsString (first_timestamp ))
356
+ if (!cJSON_IsString (first_timestamp ) && ! cJSON_IsNull ( first_timestamp ) )
357
357
{
358
358
goto end ; //DateTime
359
359
}
@@ -380,7 +380,7 @@ core_v1_event_t *core_v1_event_parseFromJSON(cJSON *core_v1_eventJSON){
380
380
// core_v1_event->last_timestamp
381
381
cJSON * last_timestamp = cJSON_GetObjectItemCaseSensitive (core_v1_eventJSON , "lastTimestamp" );
382
382
if (last_timestamp ) {
383
- if (!cJSON_IsString (last_timestamp ))
383
+ if (!cJSON_IsString (last_timestamp ) && ! cJSON_IsNull ( last_timestamp ) )
384
384
{
385
385
goto end ; //DateTime
386
386
}
@@ -463,11 +463,11 @@ core_v1_event_t *core_v1_event_parseFromJSON(cJSON *core_v1_eventJSON){
463
463
action ? strdup (action -> valuestring ) : NULL ,
464
464
api_version ? strdup (api_version -> valuestring ) : NULL ,
465
465
count ? count -> valuedouble : 0 ,
466
- event_time ? strdup (event_time -> valuestring ) : NULL ,
467
- first_timestamp ? strdup (first_timestamp -> valuestring ) : NULL ,
466
+ event_time && ! cJSON_IsNull ( event_time ) ? strdup (event_time -> valuestring ) : NULL ,
467
+ first_timestamp && ! cJSON_IsNull ( first_timestamp ) ? strdup (first_timestamp -> valuestring ) : NULL ,
468
468
involved_object_local_nonprim ,
469
469
kind ? strdup (kind -> valuestring ) : NULL ,
470
- last_timestamp ? strdup (last_timestamp -> valuestring ) : NULL ,
470
+ last_timestamp && ! cJSON_IsNull ( last_timestamp ) ? strdup (last_timestamp -> valuestring ) : NULL ,
471
471
message ? strdup (message -> valuestring ) : NULL ,
472
472
metadata_local_nonprim ,
473
473
reason ? strdup (reason -> valuestring ) : NULL ,
0 commit comments