Skip to content

Commit

Permalink
Merge pull request #8080 from kaltura/Naos-14.14.0-FileSyncFatal
Browse files Browse the repository at this point in the history
No-Plat: Validate asset found before calling shouldEncrypt, we saw cases where asset got deleted during this operation causing fatal errors
  • Loading branch information
yossipapi committed Feb 4, 2019
2 parents 7ed681d + 475775b commit 5b76c5d
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions alpha/lib/model/FileSync.php
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,12 @@ public function shouldEncryptFile()
{
/** @var Asset $asset */
$asset = assetPeer::retrieveById($this->object_id);
if(!$asset)
{
KalturaLog::debug("Asset id [" . $this->object_id . "] not found");
return false;
}

$shouldEncrypt = $asset->shouldEncrypt();
KalturaLog::debug("Asset id [$this->object_id] of type [" . $asset->getType() . "] should be encrypt: [$shouldEncrypt]");
if (!$shouldEncrypt)
Expand Down

0 comments on commit 5b76c5d

Please sign in to comment.