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

ASVideoNode delegate respondsToSelector crash. #291

Closed
ArmandsB opened this issue May 18, 2017 · 1 comment
Closed

ASVideoNode delegate respondsToSelector crash. #291

ArmandsB opened this issue May 18, 2017 · 1 comment

Comments

@ArmandsB
Copy link

Hello. I noticed that at line 156 @ ASVideoNode.mm class calls delegate function before checking if it's implemented.

- (void)prepareToPlayAsset:(AVAsset *)asset withKeys:(NSArray<NSString *> *)requestedKeys
{
  ASDisplayNodeAssertMainThread();
  
  for (NSString *key in requestedKeys) {
    NSError *error = nil;
    AVKeyValueStatus keyStatus = [asset statusOfValueForKey:key error:&error];
    if (keyStatus == AVKeyValueStatusFailed) {
      NSLog(@"Asset loading failed with error: %@", error);
      [self.delegate videoNode:self didFailToLoadValueForKey:key asset:asset error:error]; // Here is check needed
    }
  }
  
`
@SergeyPetrachkov
Copy link
Contributor

Hi @ArmandsB ! Quick fix would be to simply implement protocol ASVideoNodeDelegate with didFailToLoadValueForKey method. But right solution will be to add necessary checks to ASVideoNode.mm . I submitted this code in PR last week and obviously forgot to add flags and these checks to .mm file as i'm more Swift developer than ObjC and I cannot just leave something from swift protocol not implemented behind. Sorry for inconvenience

SergeyPetrachkov added a commit to SergeyPetrachkov/Texture that referenced this issue May 18, 2017
…ash an app because of not responding to selector;

refs TextureGroup#291
nguyenhuy pushed a commit that referenced this issue May 18, 2017
* Fixed bug where ASVideoNodeDelegate error reporting callback would crash an app because of not responding to selector;

refs #291

* updated changelog.md

* fixed typo in const name of ASVideoNodeDelegate method in delegate flags;

refs #292
SergeyPetrachkov added a commit to SergeyPetrachkov/Texture that referenced this issue May 26, 2017
* Fixed bug where ASVideoNodeDelegate error reporting callback would crash an app because of not responding to selector;

refs TextureGroup#291

* updated changelog.md

* fixed typo in const name of ASVideoNodeDelegate method in delegate flags;

refs TextureGroup#292
bernieperez pushed a commit to AtomTickets/Texture that referenced this issue Apr 25, 2018
* Fixed bug where ASVideoNodeDelegate error reporting callback would crash an app because of not responding to selector;

refs TextureGroup#291

* updated changelog.md

* fixed typo in const name of ASVideoNodeDelegate method in delegate flags;

refs TextureGroup#292
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

No branches or pull requests

2 participants