Skip to content

Commit ab1bdae

Browse files
committed
Fix unlockWithLicense
1 parent a9d9f3b commit ab1bdae

File tree

3 files changed

+16
-6
lines changed

3 files changed

+16
-6
lines changed

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
## [1.0.2]
2+
3+
### Fixed
4+
5+
* Fixed `unlockWithLicense`.
6+
17
## [1.0.0]
28

39
### Added

ios/RNImglyKit.m

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,8 @@ - (void)unlockWithLicense:(nonnull id)json
177177
{
178178
NSString *string = nil;
179179
NSURL *url = nil;
180-
if ([json isKindOfClass:[NSString class]]) {
180+
BOOL isString = [json isKindOfClass:[NSString class]];
181+
if (isString) {
181182
string = json;
182183
@try { // NSURL has a history of crashing with bad input, so let's be safe
183184
url = [NSURL URLWithString:string];
@@ -187,10 +188,13 @@ - (void)unlockWithLicense:(nonnull id)json
187188

188189
// If the user specifies a file URL we do not use the converter and use the URL without any checks
189190
if (url == nil || !url.isFileURL) {
190-
url = [RCTConvert NSURL:json];
191-
// Test if the resulting URL is an existing local file otherwise we try to read the license from a string or a dictionary
192-
if (![[NSFileManager defaultManager] fileExistsAtPath:url.path]) {
193-
url = nil;
191+
// `RCTConvert` changed the conversion for json to URL and it throws now an error if it is not a string
192+
if (isString) {
193+
url = [RCTConvert NSURL:json];
194+
// Test if the resulting URL is an existing local file otherwise we try to read the license from a string or a dictionary
195+
if (![[NSFileManager defaultManager] fileExistsAtPath:url.path]) {
196+
url = nil;
197+
}
194198
}
195199
}
196200

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "react-native-videoeditorsdk",
33
"title": "React Native module for VideoEditor SDK",
4-
"version": "1.0.1",
4+
"version": "1.0.2",
55
"description": "A React Native module for VideoEditor SDK. Integrate the video editor into your own HTML5, iOS or Android app - in minutes!",
66
"main": "index.js",
77
"typings": "index.d.ts",

0 commit comments

Comments
 (0)