Commit 285dff51 authored by Felix Paul Kühne's avatar Felix Paul Kühne

onedrive: prevent exceptions

parent f367a603
...@@ -174,9 +174,11 @@ ...@@ -174,9 +174,11 @@
else if (self.oneDriveFile.isVideo) { else if (self.oneDriveFile.isVideo) {
self.thumbnailView.image = [UIImage imageNamed:@"movie"]; self.thumbnailView.image = [UIImage imageNamed:@"movie"];
if (_oneDriveFile.thumbnailURL != nil) { if (_oneDriveFile.thumbnailURL != nil) {
if (_oneDriveFile.thumbnailURL.length > 0) {
_iconURL = [NSURL URLWithString:_oneDriveFile.thumbnailURL]; _iconURL = [NSURL URLWithString:_oneDriveFile.thumbnailURL];
[self performSelectorInBackground:@selector(_updateIconFromURL) withObject:@""]; [self performSelectorInBackground:@selector(_updateIconFromURL) withObject:@""];
} }
}
} else } else
self.thumbnailView.image = [UIImage imageNamed:@"blank"]; self.thumbnailView.image = [UIImage imageNamed:@"blank"];
} }
......
...@@ -77,8 +77,12 @@ ...@@ -77,8 +77,12 @@
if (cell == nil) if (cell == nil)
cell = [VLCCloudStorageTableViewCell cellWithReuseIdentifier:CellIdentifier]; cell = [VLCCloudStorageTableViewCell cellWithReuseIdentifier:CellIdentifier];
NSArray *items = _oneDriveController.currentFolder.items;
if (indexPath.row < items.count) {
cell.oneDriveFile = _oneDriveController.currentFolder.items[indexPath.row]; cell.oneDriveFile = _oneDriveController.currentFolder.items[indexPath.row];
cell.delegate = self; cell.delegate = self;
}
return cell; return cell;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment