diff --git a/MUSHclient.cpp b/MUSHclient.cpp index 4f1ea219..3624685a 100644 --- a/MUSHclient.cpp +++ b/MUSHclient.cpp @@ -1857,6 +1857,10 @@ CTextDocument * CMUSHclientApp::FindNotepad (const CString strTitle) { CTextDocument * pTextDoc = NULL; + // during startup, may not exist + if (App.m_pNormalDocTemplate == NULL) + return NULL; + for (POSITION docPos = App.m_pNormalDocTemplate->GetFirstDocPosition(); docPos != NULL; ) { @@ -2095,11 +2099,14 @@ void CMUSHclientApp::db_show_error (const char * sql) return; CString strTitle = "SQL errors in global preferences"; + CString strMessage = CFormat ("SQL error on statement:\r\n\"%s\"\r\n%s\r\n", sql, sqlite3_errmsg(db)); - AppendToTheNotepad (strTitle, - CFormat ("SQL error on statement:\r\n\"%s\"\r\n%s\r\n", sql, sqlite3_errmsg(db)), + if (!AppendToTheNotepad (strTitle, + strMessage, false, // append - eNotepadWorldLoadError); + eNotepadWorldLoadError)) + // emergency fallback + ::AfxMessageBox ( (LPCTSTR) strMessage, MB_ICONEXCLAMATION ); // make sure they see it ActivateNotepad (strTitle); diff --git a/MUSHclient.dsp b/MUSHclient.dsp index 5cdd4028..fcb95d5e 100644 --- a/MUSHclient.dsp +++ b/MUSHclient.dsp @@ -1133,15 +1133,8 @@ SOURCE=.\pcre\pcre_info.c # Begin Source File SOURCE=.\pcre\pcre_maketables.c - -!IF "$(CFG)" == "MUSHclient - Win32 Debug" - +# ADD CPP /D "HAVE_CONFIG_H" # SUBTRACT CPP /YX /Yc /Yu - -!ELSEIF "$(CFG)" == "MUSHclient - Win32 Release" - -!ENDIF - # End Source File # Begin Source File diff --git a/Utilities.cpp b/Utilities.cpp index 598a94b6..be223c5b 100644 --- a/Utilities.cpp +++ b/Utilities.cpp @@ -255,6 +255,9 @@ bool CreateTextWindow (const char * sText, const int iLines, const int iNotepadType) { + // during startup, may not exist + if (App.m_pNormalDocTemplate == NULL) + return false; CTextDocument * pNewDoc = (CTextDocument *) App.m_pNormalDocTemplate->OpenDocumentFile(NULL);