IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Jan 14, 2007, 2:59:16 PM (19 years ago)
Author:
magnier
Message:

added error checks

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/psModules/src/concepts/pmConceptsStandard.c

    r10722 r11091  
    419419            psList *dateTime = concept->data.V; // The list containing items for date and time
    420420            psMetadataItem *dateItem = psListGet(dateTime, PS_LIST_HEAD); // Item containing the date
    421             psMetadataItem *timeItem = psListGet(dateTime, PS_LIST_HEAD + 1); // Item containing the time
     421            if (!dateItem) {
     422                psError(PS_ERR_UNKNOWN, true, "Date is not found.\n");
     423                return NULL;
     424            }
    422425            if (dateItem->type != PS_DATA_STRING) {
    423426                psError(PS_ERR_UNKNOWN, true, "Date is not of type STR.\n");
     
    453456            sprintf(dateString,"%04d-%02d-%02d", year, month, day);
    454457
     458            psMetadataItem *timeItem = psListGet(dateTime, PS_LIST_HEAD + 1); // Item containing the time
     459            if (!timeItem) {
     460                psError(PS_ERR_UNKNOWN, true, "Time is not found.\n");
     461                return NULL;
     462            }
    455463            psString timeString = NULL; // The string with the time
    456464            if (timeItem->type == PS_DATA_STRING) {
Note: See TracChangeset for help on using the changeset viewer.