Commit 8a852a55 authored by Felix Paul Kühne's avatar Felix Paul Kühne

ATV: prevent potential runtime exceptions

parent a5ae5bae
......@@ -158,9 +158,12 @@
return nil;
}
NSString *ret;
NSString *ret = nil;
@synchronized(_recentURLs) {
ret = _recentURLs[indexPathToDelete.item];
NSInteger index = indexPathToDelete.item;
if (index < _recentURLs.count) {
ret = _recentURLs[index];
}
}
return ret;
}
......
......@@ -222,9 +222,12 @@
return nil;
}
NSString *ret;
NSString *ret = nil;
@synchronized(_discoveredFiles) {
ret = _discoveredFiles[indexPathToDelete.item];
NSInteger index = indexPathToDelete.item;
if (index < _discoveredFiles.count) {
ret = _discoveredFiles[index];
}
}
return ret;
}
......
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