Skip to content

Commit 1119a68

Browse files
Check if the metadata is NULL.
1 parent 360c6cd commit 1119a68

File tree

1 file changed

+17
-17
lines changed

1 file changed

+17
-17
lines changed

src/sonymn_int.cpp

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -827,7 +827,7 @@ std::ostream& SonyMakerNote::printWBShiftABGM(std::ostream& os, const Value& val
827827
}
828828

829829
std::ostream& SonyMakerNote::printFocusMode2(std::ostream& os, const Value& value, const ExifData* metadata) {
830-
if (value.count() != 1 || value.typeId() != unsignedByte) {
830+
if (value.count() != 1 || value.typeId() != unsignedByte || !metadata) {
831831
os << "(" << value << ")";
832832
return os;
833833
}
@@ -854,7 +854,7 @@ std::ostream& SonyMakerNote::printFocusMode2(std::ostream& os, const Value& valu
854854
}
855855

856856
std::ostream& SonyMakerNote::printAFAreaModeSetting(std::ostream& os, const Value& value, const ExifData* metadata) {
857-
if (value.count() != 1 || value.typeId() != unsignedByte) {
857+
if (value.count() != 1 || value.typeId() != unsignedByte || !metadata) {
858858
os << "(" << value << ")";
859859
return os;
860860
}
@@ -891,7 +891,7 @@ std::ostream& SonyMakerNote::printAFAreaModeSetting(std::ostream& os, const Valu
891891
}
892892

893893
std::ostream& SonyMakerNote::printFlexibleSpotPosition(std::ostream& os, const Value& value, const ExifData* metadata) {
894-
if (value.count() != 2 || value.typeId() != unsignedShort) {
894+
if (value.count() != 2 || value.typeId() != unsignedShort || !metadata) {
895895
os << "(" << value << ")";
896896
return os;
897897
}
@@ -916,7 +916,7 @@ std::ostream& SonyMakerNote::printFlexibleSpotPosition(std::ostream& os, const V
916916
}
917917

918918
std::ostream& SonyMakerNote::printAFPointSelected(std::ostream& os, const Value& value, const ExifData* metadata) {
919-
if (value.count() != 1 || value.typeId() != unsignedByte) {
919+
if (value.count() != 1 || value.typeId() != unsignedByte || !metadata) {
920920
os << "(" << value << ")";
921921
return os;
922922
}
@@ -967,7 +967,7 @@ std::ostream& SonyMakerNote::printAFPointSelected(std::ostream& os, const Value&
967967
}
968968

969969
std::ostream& SonyMakerNote::printAFPointsUsed(std::ostream& os, const Value& value, const ExifData* metadata) {
970-
if (value.typeId() != unsignedByte) {
970+
if (value.typeId() != unsignedByte || !metadata) {
971971
os << "(" << value << ")";
972972
return os;
973973
}
@@ -994,7 +994,7 @@ std::ostream& SonyMakerNote::printAFPointsUsed(std::ostream& os, const Value& va
994994
}
995995

996996
std::ostream& SonyMakerNote::printAFTracking(std::ostream& os, const Value& value, const ExifData* metadata) {
997-
if (value.count() != 1 || value.typeId() != unsignedByte) {
997+
if (value.count() != 1 || value.typeId() != unsignedByte || !metadata) {
998998
os << "(" << value << ")";
999999
return os;
10001000
}
@@ -1297,7 +1297,7 @@ std::ostream& SonyMakerNote::printImageSize(std::ostream& os, const Value& value
12971297
}
12981298

12991299
std::ostream& SonyMakerNote::printFocusMode(std::ostream& os, const Value& value, const ExifData* metadata) {
1300-
if (value.count() != 1 || value.typeId() != unsignedShort) {
1300+
if (value.count() != 1 || value.typeId() != unsignedShort || !metadata) {
13011301
os << "(" << value << ")";
13021302
return os;
13031303
}
@@ -1314,7 +1314,7 @@ std::ostream& SonyMakerNote::printFocusMode(std::ostream& os, const Value& value
13141314
}
13151315

13161316
std::ostream& SonyMakerNote::printAFMode(std::ostream& os, const Value& value, const ExifData* metadata) {
1317-
if (value.count() != 1 || value.typeId() != unsignedShort) {
1317+
if (value.count() != 1 || value.typeId() != unsignedShort || !metadata) {
13181318
os << "(" << value << ")";
13191319
return os;
13201320
}
@@ -1336,7 +1336,7 @@ std::ostream& SonyMakerNote::printAFMode(std::ostream& os, const Value& value, c
13361336
}
13371337

13381338
std::ostream& SonyMakerNote::printFocusMode3(std::ostream& os, const Value& value, const ExifData* metadata) {
1339-
if (value.count() != 1 || value.typeId() != unsignedShort) {
1339+
if (value.count() != 1 || value.typeId() != unsignedShort || !metadata) {
13401340
os << "(" << value << ")";
13411341
return os;
13421342
}
@@ -1353,7 +1353,7 @@ std::ostream& SonyMakerNote::printFocusMode3(std::ostream& os, const Value& valu
13531353

13541354
std::ostream& SonyMakerNote::printHighISONoiseReduction2(std::ostream& os, const Value& value,
13551355
const ExifData* metadata) {
1356-
if (value.count() != 1 || value.typeId() != unsignedShort) {
1356+
if (value.count() != 1 || value.typeId() != unsignedShort || !metadata) {
13571357
os << "(" << value << ")";
13581358
return os;
13591359
}
@@ -1840,7 +1840,7 @@ std::ostream& SonyMakerNote::printSony2FpFocusMode(std::ostream& os, const Value
18401840

18411841
std::ostream& SonyMakerNote::printSony2FpFocusPosition2(std::ostream& os, const Value& value,
18421842
const ExifData* metadata) {
1843-
if (value.count() != 1)
1843+
if (value.count() != 1 || !metadata)
18441844
os << "(" << value << ")";
18451845
else {
18461846
std::string model;
@@ -1944,7 +1944,7 @@ const TagInfo* SonyMakerNote::tagListSonyMisc2b() {
19441944

19451945
std::ostream& SonyMakerNote::printSonyMisc2bLensZoomPosition(std::ostream& os, const Value& value,
19461946
const ExifData* metadata) {
1947-
if (value.count() != 1)
1947+
if (value.count() != 1 || !metadata)
19481948
return os << "(" << value << ")";
19491949

19501950
std::string model;
@@ -1966,7 +1966,7 @@ std::ostream& SonyMakerNote::printSonyMisc2bLensZoomPosition(std::ostream& os, c
19661966

19671967
std::ostream& SonyMakerNote::printSonyMisc2bFocusPosition2(std::ostream& os, const Value& value,
19681968
const ExifData* metadata) {
1969-
if (value.count() != 1)
1969+
if (value.count() != 1 || !metadata)
19701970
return os << "(" << value << ")";
19711971

19721972
std::string model;
@@ -2052,7 +2052,7 @@ const TagInfo* SonyMakerNote::tagListSonyMisc3c() {
20522052

20532053
std::ostream& SonyMakerNote::printSonyMisc3cShotNumberSincePowerUp(std::ostream& os, const Value& value,
20542054
const ExifData* metadata) {
2055-
if (value.count() != 1 || value.typeId() != unsignedLong)
2055+
if (value.count() != 1 || value.typeId() != unsignedLong || !metadata)
20562056
return os << "(" << value << ")";
20572057

20582058
std::string model;
@@ -2083,7 +2083,7 @@ std::ostream& SonyMakerNote::printSonyMisc3cSequenceNumber(std::ostream& os, con
20832083
}
20842084

20852085
std::ostream& SonyMakerNote::printSonyMisc3cQuality2(std::ostream& os, const Value& value, const ExifData* metadata) {
2086-
if (value.count() != 1 || value.typeId() != unsignedByte)
2086+
if (value.count() != 1 || value.typeId() != unsignedByte || !metadata)
20872087
return os << "(" << value << ")";
20882088

20892089
std::string model;
@@ -2108,7 +2108,7 @@ std::ostream& SonyMakerNote::printSonyMisc3cQuality2(std::ostream& os, const Val
21082108

21092109
std::ostream& SonyMakerNote::printSonyMisc3cSonyImageHeight(std::ostream& os, const Value& value,
21102110
const ExifData* metadata) {
2111-
if (value.count() != 1 || value.typeId() != unsignedShort)
2111+
if (value.count() != 1 || value.typeId() != unsignedShort || !metadata)
21122112
return os << "(" << value << ")";
21132113

21142114
std::string model;
@@ -2131,7 +2131,7 @@ std::ostream& SonyMakerNote::printSonyMisc3cSonyImageHeight(std::ostream& os, co
21312131

21322132
std::ostream& SonyMakerNote::printSonyMisc3cModelReleaseYear(std::ostream& os, const Value& value,
21332133
const ExifData* metadata) {
2134-
if (value.count() != 1 || value.typeId() != unsignedByte)
2134+
if (value.count() != 1 || value.typeId() != unsignedByte || !metadata)
21352135
return os << "(" << value << ")";
21362136

21372137
std::string model;

0 commit comments

Comments
 (0)