localtime_r(&(object->first_created), tm);
- value[1] = ((tm->tm_year+1900) >> 8) & 0xFF;
- value[0] = (tm->tm_year+1900) & 0xFF;
- value[2] = (tm->tm_mon+1) & 0xFF;
- value[3] = tm->tm_mday & 0xFF;
- value[4] = tm->tm_hour & 0xFF;
- value[5] = tm->tm_min & 0xFF;
- value[6] = tm->tm_sec & 0xFF;
+ if (tm) {
+ value[1] = ((tm->tm_year+1900) >> 8) & 0xFF;
+ value[0] = (tm->tm_year+1900) & 0xFF;
+ value[2] = (tm->tm_mon+1) & 0xFF;
+ value[3] = tm->tm_mday & 0xFF;
+ value[4] = tm->tm_hour & 0xFF;
+ value[5] = tm->tm_min & 0xFF;
+ value[6] = tm->tm_sec & 0xFF;
+ }
} else if (!g_strcmp0(type, "id")) {