IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 9754


Ignore:
Timestamp:
Oct 26, 2006, 3:09:50 PM (20 years ago)
Author:
jhoblitt
Message:

fix psMetadataItemCopy() to handle NULL psTimes

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/psLib/src/types/psMetadata.c

    r9736 r9754  
    1212 *  @author Ross Harman, MHPCC
    1313 *
    14  *  @version $Revision: 1.145 $ $Name: not supported by cvs2svn $
    15  *  @date $Date: 2006-10-25 00:16:33 $
     14 *  @version $Revision: 1.146 $ $Name: not supported by cvs2svn $
     15 *  @date $Date: 2006-10-27 01:09:50 $
    1616 *
    1717 *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
     
    377377        }
    378378    case PS_DATA_TIME: {
    379             psTime *timeCopy = psTimeCopy( (psTime*)(in->data.V) );
    380             if (timeCopy == NULL) {
    381                 psError(PS_ERR_BAD_PARAMETER_NULL, false,
    382                         "Error copying time.  Time skipped.\n");
    383             } else {
    384                 newItem = psMetadataItemAlloc(in->name, PS_DATA_TIME, in->comment, timeCopy);
     379            psTime *timeCopy = NULL;
     380            // pass through NULL values
     381            if (in->data.V) {
     382                timeCopy = psTimeCopy( (psTime*)(in->data.V) );
     383                if (timeCopy == NULL) {
     384                    psError(PS_ERR_BAD_PARAMETER_NULL, false,
     385                            "Error copying time.  Time skipped.\n");
     386                }
     387            }
     388            newItem = psMetadataItemAlloc(in->name, PS_DATA_TIME, in->comment, timeCopy);
     389            if (timeCopy) {
    385390                psFree(timeCopy);   // Drop reference
    386391            }
Note: See TracChangeset for help on using the changeset viewer.