Skip to content

Commit 608e441

Browse files
committed
[[ Bug 13650 ]] Prevent a crash when opening stack
1 parent 06ec955 commit 608e441

File tree

2 files changed

+10
-4
lines changed

2 files changed

+10
-4
lines changed

docs/notes/bugfix-13650.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
# Crash when opening stack

engine/src/mac-av-player.mm

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -190,11 +190,16 @@ - (void)observeValueForKeyPath:(NSString *)keyPath ofObject:(id)object change:(N
190190
MCPlatformBreakWait();
191191
else if([keyPath isEqualToString: @"currentItem.loadedTimeRanges"])
192192
{
193-
NSArray *t_time_ranges = (NSArray *)[change objectForKey:NSKeyValueChangeNewKey];
194-
if (t_time_ranges && [t_time_ranges count])
193+
// PM-2014-10-14: [[ Bug 13650 ]] Do this check to prevent a crash
194+
if([change objectForKey:NSKeyValueChangeNewKey] != [NSNull null])
195195
{
196-
CMTimeRange timerange = [[t_time_ranges objectAtIndex:0] CMTimeRangeValue];
197-
m_av_player -> MovieIsLoading(timerange);
196+
NSArray *t_time_ranges = (NSArray *)[change objectForKey:NSKeyValueChangeNewKey];
197+
198+
if (t_time_ranges && [t_time_ranges count])
199+
{
200+
CMTimeRange timerange = [[t_time_ranges objectAtIndex:0] CMTimeRangeValue];
201+
m_av_player -> MovieIsLoading(timerange);
202+
}
198203
}
199204
}
200205
}

0 commit comments

Comments
 (0)