~osomon/pyexiv2/pyexiv2-0.3

« back to all changes in this revision

Viewing changes to src/exiv2wrapper.cpp

Check typeName for nullness.

Show diffs side-by-side

added added

removed removed

Lines of Context:
559
559
    // which we’d rather keep the 'Comment' type instead of 'Undefined'.
560
560
    if ((_data != 0) && (_type != "Comment"))
561
561
    {
562
 
        _type = _datum->typeName();
 
562
        const char* typeName = _datum->typeName();
 
563
        if (typeName != 0)
 
564
        {
 
565
            _type = typeName;
 
566
        }
563
567
    }
564
568
    _name = exifKey.tagName();
565
569
    _label = exifKey.tagLabel();
578
582
    // which we’d rather keep the 'Comment' type instead of 'Undefined'.
579
583
    if ((_data != 0) && (_type != "Comment"))
580
584
    {
581
 
        _type = _datum->typeName();
 
585
        const char* typeName = _datum->typeName();
 
586
        if (typeName != 0)
 
587
        {
 
588
            _type = typeName;
 
589
        }
582
590
    }
583
591
    _name = Exiv2::ExifTags::tagName(tag, ifd);
584
592
    _label = Exiv2::ExifTags::tagLabel(tag, ifd);