Skip to content

Commit

Permalink
Check if the metadata is NULL.
Browse files Browse the repository at this point in the history
(cherry picked from commit 360c6cd)
  • Loading branch information
kevinbackhouse authored and mergify[bot] committed Jun 29, 2023
1 parent eb303ae commit a6caaf1
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
16 changes: 8 additions & 8 deletions src/nikonmn_int.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3384,7 +3384,7 @@ std::ostream& Nikon3MakerNote::printExternalFlashData2(std::ostream& os, const V

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

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

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

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

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

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

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

std::ostream& Nikon3MakerNote::printFlashGroupCDataFl7(std::ostream& os, const Value& value, const ExifData* metadata) {
std::ios::fmtflags f(os.flags());
if (value.count() != 1 || value.typeId() != unsignedByte) {
if (value.count() != 1 || value.typeId() != unsignedByte || !metadata) {
os << "(" << value << ")";
os.flags(f);
return os;
Expand Down
4 changes: 2 additions & 2 deletions src/sonymn_int.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1799,7 +1799,7 @@ const TagInfo* SonyMakerNote::tagListFp() {

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

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

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

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

0 comments on commit a6caaf1

Please sign in to comment.