aboutsummaryrefslogtreecommitdiffhomepage
path: root/libs/knowit/properties
diff options
context:
space:
mode:
authormorpheus65535 <[email protected]>2023-03-21 23:15:01 -0400
committermorpheus65535 <[email protected]>2023-03-21 23:15:01 -0400
commit7455496c4c42518df5f20646d50a93ca66c1a912 (patch)
treef7992557e15e6d8c8494edb2789772aa4b0dce44 /libs/knowit/properties
parent71363830985a34f5f45a32972477e0ac83dce519 (diff)
downloadbazarr-7455496c4c42518df5f20646d50a93ca66c1a912.tar.gz
bazarr-7455496c4c42518df5f20646d50a93ca66c1a912.zip
Trying to fix Segmentation fault caused by mediainfo in docker container. #2098v1.2.1-beta.9
Diffstat (limited to 'libs/knowit/properties')
-rw-r--r--libs/knowit/properties/video.py9
1 files changed, 5 insertions, 4 deletions
diff --git a/libs/knowit/properties/video.py b/libs/knowit/properties/video.py
index e1b293d01..60c5b8264 100644
--- a/libs/knowit/properties/video.py
+++ b/libs/knowit/properties/video.py
@@ -106,11 +106,12 @@ class Ratio(Property[Decimal]):
if (width, height) == ('0', '1'): # identity
return Decimal('1.0')
- result = round_decimal(Decimal(width) / Decimal(height), min_digits=1, max_digits=3)
- if self.unit:
- result *= self.unit
+ if height:
+ result = round_decimal(Decimal(width) / Decimal(height), min_digits=1, max_digits=3)
+ if self.unit:
+ result *= self.unit
- return result
+ return result
self.report(value, context)
return None