Skip to content

Commit b7f2529

Browse files
Make command type more robust in case phrase is missing (#3202)
1 parent 715ed45 commit b7f2529

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

cursorless-talon/src/command.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
@dataclasses.dataclass
1111
class CursorlessCommand:
1212
version = COMMAND_VERSION
13-
spokenForm: str
13+
spokenForm: str | None
1414
usePrePhraseSnapshot: bool
1515
action: dict
1616

@@ -66,7 +66,7 @@ def construct_cursorless_command(action: dict) -> dict:
6666
except KeyError:
6767
use_pre_phrase_snapshot = False
6868

69-
spoken_form = " ".join(last_phrase["phrase"])
69+
spoken_form = " ".join(last_phrase["phrase"]) if "phrase" in last_phrase else None
7070

7171
return make_serializable(
7272
CursorlessCommand(

0 commit comments

Comments
 (0)