b0871e
--- poppler-20.11.0/glib/poppler-attachment.cc
b0871e
+++ poppler-20.11.0/glib/poppler-attachment.cc
b0871e
@@ -114,17 +114,21 @@ PopplerAttachment *_poppler_attachment_n
b0871e
         if (embFile->createDate()) {
b0871e
             priv->ctime = _poppler_convert_pdf_date_to_date_time(embFile->createDate());
b0871e
             G_GNUC_BEGIN_IGNORE_DEPRECATIONS
b0871e
-            /* This will overflow on dates from after 2038. This field is
b0871e
-             * deprecated, only kept for backward compatibility. */
b0871e
-            attachment->ctime = (GTime)g_date_time_to_unix(priv->ctime);
b0871e
+            if (priv->ctime != NULL) {
b0871e
+                /* This will overflow on dates from after 2038. This field is
b0871e
+                 * deprecated, only kept for backward compatibility. */
b0871e
+                attachment->ctime = (GTime)g_date_time_to_unix(priv->ctime);
b0871e
+            }
b0871e
             G_GNUC_END_IGNORE_DEPRECATIONS
b0871e
         }
b0871e
         if (embFile->modDate()) {
b0871e
             priv->mtime = _poppler_convert_pdf_date_to_date_time(embFile->modDate());
b0871e
             G_GNUC_BEGIN_IGNORE_DEPRECATIONS
b0871e
-            /* This will overflow on dates from after 2038. This field is
b0871e
-             * deprecated, only kept for backward compatibility. */
b0871e
-            attachment->mtime = (GTime)g_date_time_to_unix(priv->mtime);
b0871e
+            if (priv->mtime != NULL) {
b0871e
+                /* This will overflow on dates from after 2038. This field is
b0871e
+                 * deprecated, only kept for backward compatibility. */
b0871e
+                attachment->mtime = (GTime)g_date_time_to_unix(priv->mtime);
b0871e
+            }
b0871e
             G_GNUC_END_IGNORE_DEPRECATIONS
b0871e
         }
b0871e