Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mais um tratamento de index #4

Open
wants to merge 1 commit into
base: minor
Choose a base branch
from
Open

Mais um tratamento de index #4

wants to merge 1 commit into from

Conversation

tivorreda64
Copy link
Collaborator

@@ -737,7 +737,7 @@ - (void)onComplete:(NSNotification *)notification {
_index = [_order[([_orderInv[_index] intValue] + 1) % _order.count] intValue];
[self broadcastPlaybackEvent];
_justAdvanced = YES;
} else if ([_orderInv[_index] intValue] + 1 < [_order count]) {
} else if (_index < [_orderInv count] && [_orderInv[_index] intValue] + 1 < [_order count]) {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tentei mais algumas coisas pra reproduzir esse crash mas em vão...

Estou pensando aqui: se o _index for inválido, em vez de crashar vai car no else que define o estado do player como complete. Estou achando mais safe não fazer absolutamente nada quando o _index for inválido, na esperança do estado, eventualmente, ser atualizado corretamente nas próximas atualizações do AvPlayer.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants