diff --git a/core/modules/page_cache/src/StackMiddleware/PageCache.php b/core/modules/page_cache/src/StackMiddleware/PageCache.php
index 14f9df5..3c5d8e8 100644
--- a/core/modules/page_cache/src/StackMiddleware/PageCache.php
+++ b/core/modules/page_cache/src/StackMiddleware/PageCache.php
@@ -249,7 +249,10 @@ protected function fetch(Request $request, $type = self::MASTER_REQUEST, $catch
     //   interface, but see https://www.drupal.org/node/2352009 about possibly
     //   changing that.
     $tags = $response->getCacheableMetadata()->getCacheTags();
-    $date = $response->getExpires()->getTimestamp();
+    // The getExpires method could return NULL if Expires header is not set, so
+    // the returned value needs to be checked before calling getTimestamp.
+    $expires = $response->getExpires();
+    $date = ($expires == NULL) ? 0 : $expires->getTimestamp();
     $expire = ($date > time()) ? $date : Cache::PERMANENT;
     $this->set($request, $response, $expire, $tags);
 
