diff --git a/Framework/PCProject.m b/Framework/PCProject.m index 78917bc..ed3b2a7 100644 --- a/Framework/PCProject.m +++ b/Framework/PCProject.m @@ -1468,10 +1468,13 @@ NSString _editorCategory = [[_editor categoryPath] mutableCopy]; range = [_editorCategory rangeOfString:fromFile]; - [_editorCategory replaceCharactersInRange:range withString:toFile]; - - [_editor setCategoryPath:_editorCategory]; - [projectBrowser setPath:_editorCategory]; + if (range.location != NSNotFound) + { + [_editorCategory replaceCharactersInRange:range withString:toFile]; + + [_editor setCategoryPath:_editorCategory]; + [projectBrowser setPath:_editorCategory]; + } RELEASE(_editorCategory); } else diff --git a/Framework/PCProjectEditor.m b/Framework/PCProjectEditor.m index b184dfa..989ed18 100644 --- a/Framework/PCProjectEditor.m +++ b/Framework/PCProjectEditor.m @@ -218,6 +218,7 @@ if (!editor) { NSLog(@"We don't have editor for file: %@", fileName); + [self setActiveEditor: nil]; return nil; }