Skip to content

Save dialog crashing on German locale #6640

Description

@leopic
  • Searched existing issues to avoid creating duplicates.
  • Confirmed that it can be reproduced in built-in themes without customized css.
  • Searched http://support.typora.io/

Describe the bug
Save dialog crashes as there seems to be missing keys (?) in German locale.

To Reproduce
Steps to reproduce the behavior:

  1. Set language to German
  2. Restart the app
  3. Create a new file, write something on it
  4. Hit Command+S (or go to the Typora menu to see it blank)
  5. App will crash

Expected behavior
It'd expect the app not to crash 😉

Screenshots / Screencasts

English locale
Image

German locale
Image

Desktop (please complete the following information):

  • OS: macOS 26.6.2 ty

Typora Version
1.14.9 (with license)

Additional context
According to Claude:
Summary: Uncaught NSException crash (SIGABRT) in +[I18nUtils isUntitled:], called from -[Document genFileNameForPanel:], when generating a filename for the save/export panel.

Environment:

  • Typora 1.14.9 (build 7785)
  • macOS 26.6.2 (25G83), Apple M1 Pro, ARM-64 native
  • System language: German (de), Siri language: English (en) — locale mismatch present

Exception type: EXC_CRASH (SIGABRT) — uncaught Objective-C exception → abort()

Crashing thread (Thread 0, main thread):

abort()
__abort_message
demangling_terminate_handler()
_objc_terminate()
__cxa_throw
objc_exception_throw
_CFThrowFormattedException
-[__NSCFString hasPrefix:].cold.1
-[__NSCFString hasPrefix:]
+[I18nUtils isUntitled:]              <- Typora binary, offset 226420
-[Document genFileNameForPanel:]      <- Typora binary, offset 286172
_dispatch_call_block_and_release
_dispatch_client_callout
_dispatch_main_queue_drain
... (main run loop / NSApplication run)

Last Exception Backtrace (Foundation exception, before it propagated):

__exceptionPreprocess
objc_exception_throw
mutateError
-[__NSCFString hasSuffix:].cold.1
-[__NSArrayM countByEnumeratingWithState:objects:count:]
+[I18nUtils isUntitled:]
-[Document genFileNameForPanel:]
... (same dispatch/run-loop tail)

Analysis: isUntitled: calls hasPrefix:/hasSuffix: on what should be an NSString, but the "Last Exception Backtrace" shows an NSArrayM (mutable array) enumeration frame immediately adjacent to the string-mutation call — suggesting an array (or some non-string/nil object) is being passed into isUntitled: where a filename string is expected, causing Foundation to throw -[__NSArrayM hasPrefix:]: unrecognized selector (or a nil-argument exception), which is uncaught and aborts the process.

Trigger: Occurred on the main thread while generating a filename for a save panel (genFileNameForPanel:), i.e. likely during Save/Save As on a document. Given the German/English language mismatch in system settings, this may be locale-related (I18nUtils doing locale-dependent title/language detection).

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions