Skip to content

Commit 360c6cd

Browse files
Check if the metadata is NULL.
1 parent 6b186a4 commit 360c6cd

File tree

2 files changed

+10
-10
lines changed

2 files changed

+10
-10
lines changed

src/nikonmn_int.cpp

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3384,7 +3384,7 @@ std::ostream& Nikon3MakerNote::printExternalFlashData2(std::ostream& os, const V
33843384

33853385
std::ostream& Nikon3MakerNote::printFlashMasterDataFl6(std::ostream& os, const Value& value, const ExifData* metadata) {
33863386
std::ios::fmtflags f(os.flags());
3387-
if (value.count() != 1 || value.typeId() != unsignedByte) {
3387+
if (value.count() != 1 || value.typeId() != unsignedByte || !metadata) {
33883388
os << "(" << value << ")";
33893389
os.flags(f);
33903390
return os;
@@ -3413,7 +3413,7 @@ std::ostream& Nikon3MakerNote::printFlashMasterDataFl6(std::ostream& os, const V
34133413

34143414
std::ostream& Nikon3MakerNote::printFlashMasterDataFl7(std::ostream& os, const Value& value, const ExifData* metadata) {
34153415
std::ios::fmtflags f(os.flags());
3416-
if (value.count() != 1 || value.typeId() != unsignedByte) {
3416+
if (value.count() != 1 || value.typeId() != unsignedByte || !metadata) {
34173417
os << "(" << value << ")";
34183418
os.flags(f);
34193419
return os;
@@ -3480,7 +3480,7 @@ std::ostream& Nikon3MakerNote::printFlashGroupBCControlData(std::ostream& os, co
34803480

34813481
std::ostream& Nikon3MakerNote::printFlashGroupADataFl6(std::ostream& os, const Value& value, const ExifData* metadata) {
34823482
std::ios::fmtflags f(os.flags());
3483-
if (value.count() != 1 || value.typeId() != unsignedByte) {
3483+
if (value.count() != 1 || value.typeId() != unsignedByte || !metadata) {
34843484
os << "(" << value << ")";
34853485
os.flags(f);
34863486
return os;
@@ -3509,7 +3509,7 @@ std::ostream& Nikon3MakerNote::printFlashGroupADataFl6(std::ostream& os, const V
35093509

35103510
std::ostream& Nikon3MakerNote::printFlashGroupADataFl7(std::ostream& os, const Value& value, const ExifData* metadata) {
35113511
std::ios::fmtflags f(os.flags());
3512-
if (value.count() != 1 || value.typeId() != unsignedByte) {
3512+
if (value.count() != 1 || value.typeId() != unsignedByte || !metadata) {
35133513
os << "(" << value << ")";
35143514
os.flags(f);
35153515
return os;
@@ -3538,7 +3538,7 @@ std::ostream& Nikon3MakerNote::printFlashGroupADataFl7(std::ostream& os, const V
35383538

35393539
std::ostream& Nikon3MakerNote::printFlashGroupBDataFl6(std::ostream& os, const Value& value, const ExifData* metadata) {
35403540
std::ios::fmtflags f(os.flags());
3541-
if (value.count() != 1 || value.typeId() != unsignedByte) {
3541+
if (value.count() != 1 || value.typeId() != unsignedByte || !metadata) {
35423542
os << "(" << value << ")";
35433543
os.flags(f);
35443544
return os;
@@ -3567,7 +3567,7 @@ std::ostream& Nikon3MakerNote::printFlashGroupBDataFl6(std::ostream& os, const V
35673567

35683568
std::ostream& Nikon3MakerNote::printFlashGroupBDataFl7(std::ostream& os, const Value& value, const ExifData* metadata) {
35693569
std::ios::fmtflags f(os.flags());
3570-
if (value.count() != 1 || value.typeId() != unsignedByte) {
3570+
if (value.count() != 1 || value.typeId() != unsignedByte || !metadata) {
35713571
os << "(" << value << ")";
35723572
os.flags(f);
35733573
return os;
@@ -3596,7 +3596,7 @@ std::ostream& Nikon3MakerNote::printFlashGroupBDataFl7(std::ostream& os, const V
35963596

35973597
std::ostream& Nikon3MakerNote::printFlashGroupCDataFl6(std::ostream& os, const Value& value, const ExifData* metadata) {
35983598
std::ios::fmtflags f(os.flags());
3599-
if (value.count() != 1 || value.typeId() != unsignedByte) {
3599+
if (value.count() != 1 || value.typeId() != unsignedByte || !metadata) {
36003600
os << "(" << value << ")";
36013601
os.flags(f);
36023602
return os;
@@ -3625,7 +3625,7 @@ std::ostream& Nikon3MakerNote::printFlashGroupCDataFl6(std::ostream& os, const V
36253625

36263626
std::ostream& Nikon3MakerNote::printFlashGroupCDataFl7(std::ostream& os, const Value& value, const ExifData* metadata) {
36273627
std::ios::fmtflags f(os.flags());
3628-
if (value.count() != 1 || value.typeId() != unsignedByte) {
3628+
if (value.count() != 1 || value.typeId() != unsignedByte || !metadata) {
36293629
os << "(" << value << ")";
36303630
os.flags(f);
36313631
return os;

src/sonymn_int.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1799,7 +1799,7 @@ const TagInfo* SonyMakerNote::tagListFp() {
17991799

18001800
std::ostream& SonyMakerNote::printSony2FpAmbientTemperature(std::ostream& os, const Value& value,
18011801
const ExifData* metadata) {
1802-
if (value.count() != 1)
1802+
if (value.count() != 1 || !metadata)
18031803
return os << "(" << value << ")";
18041804

18051805
auto pos = metadata->findKey(ExifKey("Exif.Sony2Fp.0x0002"));
@@ -1879,7 +1879,7 @@ const TagInfo* SonyMakerNote::tagListSonyMisc1() {
18791879

18801880
std::ostream& SonyMakerNote::printSonyMisc1CameraTemperature(std::ostream& os, const Value& value,
18811881
const ExifData* metadata) {
1882-
if (value.count() != 1)
1882+
if (value.count() != 1 || !metadata)
18831883
return os << "(" << value << ")";
18841884

18851885
auto pos = metadata->findKey(ExifKey("Exif.SonyMisc1.0x0004"));

0 commit comments

Comments
 (0)