Skip to content

Commit 45e09b3

Browse files
Update ImGuiFileDialog.cpp
fix when m_CurrentPathDecomposition is empty bug
1 parent 46f8d3f commit 45e09b3

1 file changed

Lines changed: 5 additions & 3 deletions

File tree

ImGuiFileDialog.cpp

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2498,9 +2498,11 @@ void IGFD::FileManager::DrawPathComposer(const FileDialogInternal& vFileDialogIn
24982498
if (IMGUI_BUTTON(editPathButtonString)) {
24992499
inputPathActivated = !inputPathActivated;
25002500
if (inputPathActivated) {
2501-
auto endIt = m_CurrentPathDecomposition.end();
2502-
m_CurrentPath = ComposeNewPath(--endIt);
2503-
IGFD::Utils::SetBuffer(inputPathBuffer, MAX_PATH_BUFFER_SIZE, m_CurrentPath);
2501+
if (!m_CurrentPathDecomposition.empty()) {
2502+
auto endIt = m_CurrentPathDecomposition.end();
2503+
m_CurrentPath = ComposeNewPath(--endIt);
2504+
IGFD::Utils::SetBuffer(inputPathBuffer, MAX_PATH_BUFFER_SIZE, m_CurrentPath);
2505+
}
25042506
}
25052507
}
25062508
if (ImGui::IsItemHovered())

0 commit comments

Comments
 (0)