Skip to content

Commit 63210bf

Browse files
committed
Restore guards (fix 'main' regression)
1 parent 2f96369 commit 63210bf

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

av/audio/fifo.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -192,15 +192,21 @@ def read_many(self, samples: cython.int, partial: cython.bint = False):
192192
@property
193193
def format(self):
194194
"""The :class:`.AudioFormat` of this FIFO."""
195+
if not self.ptr:
196+
raise AttributeError(f"'{__name__}.AudioFifo' object has no attribute 'format'")
195197
return self.template.format
196198

197199
@property
198200
def layout(self):
199201
"""The :class:`.AudioLayout` of this FIFO."""
202+
if not self.ptr:
203+
raise AttributeError(f"'{__name__}.AudioFifo' object has no attribute 'layout'")
200204
return self.template.layout
201205

202206
@property
203207
def sample_rate(self):
208+
if not self.ptr:
209+
raise AttributeError(f"'{__name__}.AudioFifo' object has no attribute 'sample_rate'")
204210
return self.template.sample_rate
205211

206212
@property

0 commit comments

Comments
 (0)