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;