@@ -827,7 +827,7 @@ std::ostream& SonyMakerNote::printWBShiftABGM(std::ostream& os, const Value& val
827827}
828828
829829std::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
856856std::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
893893std::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
918918std::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
969969std::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
996996std::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
12991299std::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
13161316std::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
13381338std::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
13541354std::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 }
@@ -1799,7 +1799,7 @@ const TagInfo* SonyMakerNote::tagListFp() {
17991799
18001800std::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" ));
@@ -1840,7 +1840,7 @@ std::ostream& SonyMakerNote::printSony2FpFocusMode(std::ostream& os, const Value
18401840
18411841std::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;
@@ -1879,7 +1879,7 @@ const TagInfo* SonyMakerNote::tagListSonyMisc1() {
18791879
18801880std::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" ));
@@ -1944,7 +1944,7 @@ const TagInfo* SonyMakerNote::tagListSonyMisc2b() {
19441944
19451945std::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
19671967std::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
20532053std::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
20852085std::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
21092109std::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
21322132std::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