Skip to content

Commit

Permalink
Fix a couple of bugs found with the static analyzer.
Browse files Browse the repository at this point in the history
  • Loading branch information
MaddTheSane committed Feb 24, 2023
1 parent f9cd44d commit 62e20e0
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 5 deletions.
4 changes: 3 additions & 1 deletion Classes/Managed Objects/TSSTManagedGroup.m
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,9 @@ - (NSURL *)fileURL
{
fileURL = nil;
[[self managedObjectContext] deleteObject: self];
[NSApp presentError: urlError];
if (urlError) {
[NSApp presentError: urlError];
}
}
else if (stale)
{
Expand Down
4 changes: 2 additions & 2 deletions Classes/Managed Objects/TSSTPage.m
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,7 @@ - (NSImage *)pageImage
- (NSImage *)textPage
{
__block NSData * textData;
if(self.index)
if(self.index != nil)
{
[self.group requestDataForPageIndex: [self.index integerValue] completionHandler:^(NSData * _Nullable pageData, NSError * _Nullable error) {
textData = pageData;
Expand Down Expand Up @@ -302,7 +302,7 @@ - (NSData *)pageData
{
__block NSData * imageData = nil;
TSSTManagedGroup * group = self.group;
if(self.index)
if(self.index != nil)
{
NSInteger entryIndex = [self.index integerValue];
[group requestDataForPageIndex:entryIndex completionHandler:^(NSData * _Nullable pageData, NSError * _Nullable error) {
Expand Down
3 changes: 3 additions & 0 deletions Classes/Session/TSSTSessionWindowController.m
Original file line number Diff line number Diff line change
Expand Up @@ -1165,6 +1165,9 @@ - (void)changeViewImages
titleString = [NSString stringWithFormat:@"%@%@", fileName, titleString];
}
}
if (fileName == nil) {
fileName = representationURL.lastPathComponent;
}
if (@available(macOS 11.0, *)) {
self.window.title = fileName;
self.window.subtitle = [titleString stringByReplacingOccurrencesOfString:[NSString stringWithFormat:@"%@", fileName] withString:@""];
Expand Down
2 changes: 1 addition & 1 deletion QuickComic/DTPartialArchiveParser.m
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ -(void)archiveParser:(XADArchiveParser *)parser foundEntryWithDictionary:(NSDict

if(!isres)
{
XADString * name = dict[XADFileNameKey];
id<XADString> name = dict[XADFileNameKey];
NSString * encodedName = [name stringWithEncodingName:parser.encodingName];
// NSLog(@"Encoded Name: %@", encodedName);
if([searchString isEqualToString: encodedName])
Expand Down
2 changes: 1 addition & 1 deletion Vendor/XADMaster

0 comments on commit 62e20e0

Please sign in to comment.