Skip to content

Commit

Permalink
Merge pull request #948 from Sequel-Ace/fix-some-crashes
Browse files Browse the repository at this point in the history
  • Loading branch information
Jason-Morcos committed Mar 6, 2021
2 parents 588d1c4 + 60f7fb2 commit a704611
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -929,7 +929,12 @@ - (void)updateFavoriteSelection:(id)sender
}

// Store the selected favorite ID for use with the document on connection
if ([fav objectForKey:SPFavoriteIDKey]) [self setConnectionKeychainID:[[fav objectForKey:SPFavoriteIDKey] stringValue]];
if ([fav objectForKey:SPFavoriteIDKey]){
id obj = [fav safeObjectForKey:SPFavoriteIDKey];
if([obj respondsToSelector:@selector(stringValue)]){
[self setConnectionKeychainID:[obj stringValue]];
}
}

// And the same for the SSH password
connectionSSHKeychainItemName = !fav ? nil : [keychain nameForSSHForFavoriteName:[fav objectForKey:SPFavoriteNameKey] id:[fav objectForKey:SPFavoriteIDKey]];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -450,7 +450,19 @@ - (void)setTableDetails:(NSDictionary *)tableDetails {

// Set the maximum table rows to an estimated count pre-load
NSString *rows = [tableDataInstance statusValueForKey:@"Rows"];
maxNumRows = (rows && ![rows isNSNull])? [rows integerValue] : 0;

if(rows && ![rows isNSNull]){
if([rows respondsToSelector:@selector(integerValue)] == YES){
maxNumRows = [rows integerValue];
}
else{
maxNumRows = 0;
}
}
else{
maxNumRows = 0;
}

maxNumRowsIsEstimate = YES;
}

Expand Down
2 changes: 1 addition & 1 deletion Source/Controllers/Other/SQLiteHistoryManager.swift
Original file line number Diff line number Diff line change
Expand Up @@ -377,7 +377,7 @@ typealias SASchemaBuilder = (_ db: FMDatabase, _ schemaVersion: Int) -> Void
Log.error("Query failed: \(error.localizedDescription)")

DispatchQueue.background(background: {
Analytics.trackEvent("error", withProperties: ["dbError":error.localizedDescription])
Analytics.trackEvent("error", withProperties: ["dbError":error.localizedDescription, "sqliteLibVersion" : FMDatabase.sqliteLibVersion()])
})
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ - (IBAction)addIndex:(id)sender
// Build an array of all indexed column names
for (NSDictionary *index in indexes)
{
[indexedFieldNames addObject:[index objectForKey:@"Column_name"]];
[indexedFieldNames safeAddObject:[index objectForKey:@"Column_name"]];
}

NSDictionary *initialField = nil;
Expand Down

0 comments on commit a704611

Please sign in to comment.