Merge pull request #296 from JamesCrowMedia/pos-null-ios-bugfix

Add second check for position values (iOS)
This commit is contained in:
pwlin 2020-05-15 08:50:13 +01:00 committed by GitHub
commit 12c45dab04
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -83,7 +83,8 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//Opens the file preview
CGRect rect;
if ([command.arguments count] >= 4) {
if ([command.arguments count] >= 4
&& ![[command.arguments objectAtIndex:3] isEqual: [NSNull null]]) {
NSArray *positionValues = [command.arguments objectAtIndex:3];
rect = CGRectMake(0, 0, [[positionValues objectAtIndex:0] floatValue], [[positionValues objectAtIndex:1] floatValue]);
} else {