Merge "Type hint against LinkTarget in WatchedItemStore"
[lhc/web/wiklou.git] / includes / Revision / SlotRecord.php
index 89980f4..7465f79 100644 (file)
@@ -219,8 +219,6 @@ class SlotRecord {
        }
 
        /**
-        * SlotRecord constructor.
-        *
         * The following fields are supported by the $row parameter:
         *
         *   $row->blob_data
@@ -541,6 +539,11 @@ class SlotRecord {
                try {
                        $sha1 = $this->getStringField( 'content_sha1' );
                } catch ( IncompleteRevisionException $ex ) {
+                       $sha1 = null;
+               }
+
+               // Compute if missing. Missing could mean null or empty.
+               if ( $sha1 === null || $sha1 === '' ) {
                        $format = $this->hasField( 'format_name' )
                                ? $this->getStringField( 'format_name' )
                                : null;