diff --git a/PowerEditor/src/MISC/PluginsManager/Notepad_plus_msgs.h b/PowerEditor/src/MISC/PluginsManager/Notepad_plus_msgs.h index 77a4f8ac8988..4439287f3394 100644 --- a/PowerEditor/src/MISC/PluginsManager/Notepad_plus_msgs.h +++ b/PowerEditor/src/MISC/PluginsManager/Notepad_plus_msgs.h @@ -985,6 +985,7 @@ enum Platform { PF_UNKNOWN, PF_X86, PF_X64, PF_IA64, PF_ARM64 }; // Get the Current native language file name string. Use it after getting NPPN_READY notification to find out which native language is used. // Users should call it with nativeLangFileName as NULL to get the required number of char (not including the terminating nul character), // allocate language file name string buffer with the return value + 1, then call it again to get the current native language file name string. + // If there's no localization file aplied, the returned value is 0. // wParam[in]: strLen is "language file name string" buffer length // lParam[out]: language file name string receives all copied native language file name string // Return the number of char copied/to copy diff --git a/PowerEditor/src/NppBigSwitch.cpp b/PowerEditor/src/NppBigSwitch.cpp index 3d619df5561e..375ee79abdaf 100644 --- a/PowerEditor/src/NppBigSwitch.cpp +++ b/PowerEditor/src/NppBigSwitch.cpp @@ -3761,7 +3761,11 @@ LRESULT Notepad_plus::process(HWND hwnd, UINT message, WPARAM wParam, LPARAM lPa case NPPM_GETNATIVELANGFILENAME: { - string fileName = _nativeLangSpeaker.getFileName(); + const char* fn = _nativeLangSpeaker.getFileName(); + + if (!fn) return 0; + + string fileName = fn; if (lParam != 0) { if (fileName.length() >= static_cast(wParam))