f0cf74
From 5405d61623e82896e498c5c8342dd6f42e689115 Mon Sep 17 00:00:00 2001
f0cf74
From: clanmills <robin@clanmills.com>
f0cf74
Date: Tue, 12 Sep 2017 09:14:42 +0100
f0cf74
Subject: [PATCH] Fix http://dev.exiv2.org/issues/1305
f0cf74
f0cf74
---
f0cf74
 src/pentaxmn.cpp | 2 ++
f0cf74
 1 file changed, 2 insertions(+)
f0cf74
f0cf74
diff --git a/src/pentaxmn.cpp b/src/pentaxmn.cpp
f0cf74
index 4fc38be0a..b22cb43b6 100644
f0cf74
--- a/src/pentaxmn.cpp
f0cf74
+++ b/src/pentaxmn.cpp
f0cf74
@@ -1167,6 +1167,8 @@ namespace Exiv2 {
f0cf74
 
f0cf74
     std::ostream& PentaxMakerNote::printShutterCount(std::ostream& os, const Value& value, const ExifData* metadata)
f0cf74
     {
f0cf74
+        if ( ! metadata ) return os << "undefined" ;
f0cf74
+
f0cf74
         ExifData::const_iterator dateIt = metadata->findKey(
f0cf74
                 ExifKey("Exif.PentaxDng.Date"));
f0cf74
         if (dateIt == metadata->end()) {