javalent / dice-roller

Inline dice rolling for Obsidian.md
268 stars 28 forks source link

[Bug]: Tag rollers return empty results #232

Open rstenner opened 1 year ago

rstenner commented 1 year ago

Check for existing bug reports before submitting.

Expected Behavior

Given a vault with #tags used in one document, dice: #tags\|link should always roll the same result.

Current behaviour

an error is thrown in the console when nothing is shown:

Uncaught (in promise) TypeError: Cannot read properties of undefined (reading 'file') at v6.build (plugin:obsidian-dice-roller:500:616) at v6.render (plugin:obsidian-dice-roller:472:4530) at eval (plugin:obsidian-dice-roller:500:1413) at e.tryTrigger (app.js:1:906862) at e.trigger (app.js:1:906795) at v6.getFiles (plugin:obsidian-dice-roller:500:190)

Reproduction

  1. Launch obsidian in sandbox mode
  2. install Dataview plugin
  3. install Dice Roller plugin
  4. create a new note and type dice: #tags\|link
  5. clicking the dice to reroll will randomly roll [[Task]] and nothing approximately 50/50.

Which Operating Systems are you using?

Obsidian Version Check

1.3.5

Plugin Version

9.0.0 and 9.2.0

Confirmation

Possible solution

Array indexing off by 1?

kyriss42 commented 8 months ago

I can confirm this bug. It is still present in the current version 10.4.1

That's why I'm still using 8.16.0 in which the correct links are generated.