From 912d3e7e42c9c3f831dbb6d221ec12a3a75bcff8 Mon Sep 17 00:00:00 2001 From: Rutger Speksnijder Date: Sun, 1 Jan 2017 15:19:31 +0100 Subject: [PATCH] Added check for null status Status is null when adding from magnet links. This cuases a fatal error when adding a torrent and creating the torrent object. --- lib/Transmission/Model/Torrent.php | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/lib/Transmission/Model/Torrent.php b/lib/Transmission/Model/Torrent.php index 45acc49..a7b85f0 100644 --- a/lib/Transmission/Model/Torrent.php +++ b/lib/Transmission/Model/Torrent.php @@ -47,7 +47,7 @@ class Torrent extends AbstractModel * @var integer */ protected $startDate; - + /** * @var integer */ @@ -92,7 +92,7 @@ class Torrent extends AbstractModel * @var double */ protected $uploadRatio; - + /** * @var string */ @@ -201,7 +201,10 @@ public function setStatus($status) */ public function getStatus() { - return $this->status->getValue(); + if ($this->status !== null) { + return $this->status->getValue(); + } + return null; } /** @@ -417,7 +420,7 @@ public function isSeeding() { return $this->status->isSeeding(); } - + /** * @return string */