Taitava / obsidian-shellcommands

Execute system commands via hotkeys or command palette in Obsidian (https://obsidian.md). Some automated events are also supported, and execution via URI links.
GNU General Public License v3.0
348 stars 11 forks source link

{{yaml_value}}: Crash if a queried property has a null value #277

Closed Taitava closed 1 year ago

Taitava commented 1 year ago

With this kind of YAML in currently open file:

---
test_suite_version: 0.16.0
tags:
  - frontmatter-tag
  - this-should-not-appear-twice
yaml_test1:
  first_item: first_value
  middle_item:
  last_item: last_value
yaml_test2:
  - first-item
  - second-item
  - last-item
---

Note that middle_item has no value!

This shell command: echo "YAML test: A1. "{{yaml_value:yaml_test1.first_item}}" A2. "{{yaml_value:yaml_test1.middle_item.inner_item}}" A3. "{{yaml_value:yaml_test1.last_item}}" B) first: "{{yaml_value:yaml_test2.0}}" B) second: "{{yaml_value:yaml_test2.1}}" B) last: "{{yaml_value:yaml_test2.-1}}" B) count: "{{yaml_value:yaml_test2.length}} >> TestResults.md

Produces this crash:

kuva

TODO:

Taitava commented 1 year ago

Fixed and will be released in 0.18.0.