mirror of
https://github.com/rive-app/rive-ios.git
synced 2026-01-18 17:11:28 +01:00
fix(apple): fix crash when valid web url address fails to import (#10515) 924860c1bb
Co-authored-by: David Skuza <david@rive.app>
This commit is contained in:
@@ -1 +1 @@
|
||||
84075d79897b09973dc4666df3184dce8a73e36a
|
||||
924860c1bb6fcf3c1bb0e98af5b70b8504bd91e1
|
||||
|
||||
@@ -292,7 +292,15 @@
|
||||
self.isLoaded = true;
|
||||
[RiveLogger logLoadedFromURL:URL];
|
||||
dispatch_async(dispatch_get_main_queue(), ^{
|
||||
if ([[NSThread currentThread] isMainThread])
|
||||
if (error)
|
||||
{
|
||||
if ([self.delegate respondsToSelector:@selector
|
||||
(riveFileDidError:)])
|
||||
{
|
||||
[self.delegate riveFileDidError:error];
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if ([self.delegate respondsToSelector:@selector
|
||||
(riveFileDidLoad:error:)])
|
||||
@@ -310,6 +318,13 @@
|
||||
URL.absoluteString,
|
||||
error.localizedDescription];
|
||||
[RiveLogger logFile:nil error:message];
|
||||
dispatch_async(dispatch_get_main_queue(), ^{
|
||||
if ([self.delegate
|
||||
respondsToSelector:@selector(riveFileDidError:)])
|
||||
{
|
||||
[self.delegate riveFileDidError:error];
|
||||
}
|
||||
});
|
||||
}
|
||||
}];
|
||||
|
||||
|
||||
@@ -190,6 +190,7 @@ typedef bool (^LoadAsset)(RiveFileAsset* asset,
|
||||
*/
|
||||
@protocol RiveFileDelegate <NSObject>
|
||||
- (BOOL)riveFileDidLoad:(RiveFile*)riveFile error:(NSError**)error;
|
||||
- (void)riveFileDidError:(NSError*)error;
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
|
||||
@@ -633,7 +633,11 @@ import Combine
|
||||
animationName: defaultModel.animationName
|
||||
)
|
||||
}
|
||||
|
||||
|
||||
@objc open func riveFileDidError(_ error: any Error) {
|
||||
|
||||
}
|
||||
|
||||
// MARK: - RivePlayer Delegate
|
||||
|
||||
@objc open func player(playedWithModel riveModel: RiveModel?) { }
|
||||
|
||||
Reference in New Issue
Block a user