IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 20417


Ignore:
Timestamp:
Oct 27, 2008, 2:13:19 PM (18 years ago)
Author:
Paul Price
Message:

Shouldn't generate an error when the key doesn't exist --- test for it first.

File:
1 edited

Legend:

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

    r20130 r20417  
    1212 *  @author Ross Harman, MHPCC
    1313 *
    14  *  @version $Revision: 1.173 $ $Name: not supported by cvs2svn $
    15  *  @date $Date: 2008-10-14 01:48:30 $
     14 *  @version $Revision: 1.174 $ $Name: not supported by cvs2svn $
     15 *  @date $Date: 2008-10-28 00:13:19 $
    1616 *
    1717 *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
     
    670670        }
    671671
    672         if (flags & PS_META_REPLACE) {
     672        if ((flags & PS_META_REPLACE) && psMetadataLookup(md, key)) {
    673673            // drop the existing entry or entries
    674             psMetadataRemoveKey(md, key);
     674            if (!psMetadataRemoveKey(md, key)) {
     675                psError(PS_ERR_UNKNOWN, false, "Unable to remove existing item to replace");
     676                return false;
     677            }
    675678        } else {
    676679            // elevate the existing hash entry to be PS_DATA_METADATA_MULTI
Note: See TracChangeset for help on using the changeset viewer.