]> git.saurik.com Git - wxWidgets.git/blobdiff - src/common/docview.cpp
documenting events that are not available on OSX, closes #10776
[wxWidgets.git] / src / common / docview.cpp
index 5dae19b52bb071f1ee1d6f45c5d8f8d6e78d3863..6658e51f0e7d4e5e7c199b93648bafee5138577b 100644 (file)
@@ -991,9 +991,9 @@ wxString wxDocManager::GetLastDirectory() const
         // this ensures that if the user opens a file, closes the program and
         // runs it again the "Open file" dialog will open in the directory of
         // the last file he used
-        wxString lastOpened = GetHistoryFile(0);
-        if ( !lastOpened.empty() )
+        if ( m_fileHistory && m_fileHistory->GetCount() )
         {
+            const wxString lastOpened = m_fileHistory->GetHistoryFile(0);
             const wxFileName fn(lastOpened);
             if ( fn.DirExists() )
             {
@@ -1001,6 +1001,7 @@ wxString wxDocManager::GetLastDirectory() const
             }
             //else: should we try the next one?
         }
+        //else: no history yet
 
         // if we don't have any files in the history (yet?), use the
         // system-dependent default location for the document files