diff --git a/src/Code/Converters/TtmlConverter.php b/src/Code/Converters/TtmlConverter.php index b68feb0..74c4b4d 100644 --- a/src/Code/Converters/TtmlConverter.php +++ b/src/Code/Converters/TtmlConverter.php @@ -155,8 +155,8 @@ protected static function internalTimeToTtml($internal_time) protected static function framesPerSecond($dom) { $ttElement = $dom->getElementsByTagName('tt')->item(0); - $frameRate = $ttElement->getAttributeNS('http://www.w3.org/ns/ttml#parameter', 'frameRate'); - $frameRateMultiplier = $ttElement->getAttributeNS('http://www.w3.org/ns/ttml#parameter', 'frameRateMultiplier'); + $frameRate = $ttElement?->getAttributeNS('http://www.w3.org/ns/ttml#parameter', 'frameRate'); + $frameRateMultiplier = $ttElement?->getAttributeNS('http://www.w3.org/ns/ttml#parameter', 'frameRateMultiplier'); if ($frameRate && $frameRateMultiplier) { list($numerator, $denominator) = array_map('intval', explode(' ', $frameRateMultiplier));