Skip to content
This repository was archived by the owner on Jun 19, 2025. It is now read-only.

Commit 7caa1dc

Browse files
authored
Merge pull request #372 from wordpress-mobile/issue/371-optional-filename-protocol-member-acccessed-without-conformance-check
371 Check conformance on call to optional method
2 parents 939737f + 07b5f8a commit 7caa1dc

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

Pod/Classes/WPMediaCollectionViewCell.m

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -210,7 +210,11 @@ - (void)configureAccessibility
210210
accessibilityLabel = [NSString stringWithFormat:NSLocalizedString(@"Audio, %@", @"Accessibility label for audio items in the media collection view. The parameter is the creation date of the audio."), formattedDate];
211211
break;
212212
case WPMediaTypeOther:
213-
accessibilityLabel = [NSString stringWithFormat:NSLocalizedString(@"Document: %@", @"Accessibility label for other media items in the media collection view. The parameter is the filename file."), [_asset filename]];
213+
if([_asset respondsToSelector:@selector(filename)]) {
214+
accessibilityLabel = [NSString stringWithFormat:NSLocalizedString(@"Document: %@", @"Accessibility label for other media items in the media collection view. The parameter is the filename file."), [_asset filename]];
215+
} else {
216+
accessibilityLabel = [NSString stringWithFormat:NSLocalizedString(@"Document, %@", @"Accessibility label for other media items in the media collection view. The parameter is the creation date of the document."), formattedDate];
217+
}
214218
break;
215219
default:
216220
break;

WPMediaPicker.podspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
Pod::Spec.new do |s|
44
s.name = 'WPMediaPicker'
5-
s.version = '1.7.2'
5+
s.version = '1.7.3-beta.1'
66

77
s.summary = 'WPMediaPicker is an iOS controller that allows capture and picking of media assets.'
88
s.description = <<-DESC

0 commit comments

Comments
 (0)