fix: crash when open a project that has files not opened in editor
This commit is contained in:
parent
8fe0854f92
commit
0e0a87584e
|
@ -642,13 +642,14 @@ void Project::associateEditor(Editor *editor)
|
|||
|
||||
void Project::associateEditorToUnit(Editor *editor, PProjectUnit unit)
|
||||
{
|
||||
if (!unit)
|
||||
if (!unit) {
|
||||
if (editor)
|
||||
editor->setInProject(false);
|
||||
return;
|
||||
}
|
||||
if (editor) {
|
||||
unit->setEncoding(editor->encodingOption());
|
||||
editor->setInProject(true);
|
||||
} else {
|
||||
editor->setInProject(false);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue