# Bug Report: Editor updating non existing card

**URL:** <https://forums.ankiweb.net/t/bug-report-editor-updating-non-existing-card/2117>\
**Category:** Help\
**Created:** [August 10, 2020, 11:12am UTC](https://forums.ankiweb.net/t/bug-report-editor-updating-non-existing-card/2117 "2020-08-10T11:12:55Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![hengiesel](https://sea2.discourse-cdn.com/flex002/user_avatar/forums.ankiweb.net/hengiesel/32/920_2.png) [@hengiesel](https://forums.ankiweb.net/u/hengiesel)\
**Post date:** [August 10, 2020, 11:12am UTC](https://forums.ankiweb.net/t/bug-report-editor-updating-non-existing-card/2117/1 "2020-08-10T11:12:55Z")

</div>

This causes a few steps to trigger:

1. Open the reviewer
2. Open the EditCurrent
3. Open the browser
4. Delete the current card in the browser
5. Close the EditCurrent

This gives me the following exception:

```auto
Caught exception:
Traceback (most recent call last):
  File "aqt/webview.py", line 493, in handler
  File "aqt/editor.py", line 485, in <lambda>
  File "aqt/editcurrent.py", line 72, in _saveAndClose
  File "aqt/main.py", line 646, in moveToState
  File "aqt/main.py", line 668, in _reviewState
  File "aqt/reviewer.py", line 65, in show
  File "aqt/reviewer.py", line 118, in nextCard
  File "aqt/reviewer.py", line 183, in _showQuestion
  File "anki/cards.py", line 113, in question
  File "anki/cards.py", line 132, in render_output
  File "anki/template.py", line 115, in from_existing_card
  File "anki/cards.py", line 142, in note
  File "anki/collection.py", line 309, in getNote
  File "anki/notes.py", line 34, in __init__
  File "anki/notes.py", line 40, in load
  File "anki/rsbackend_gen.py", line 350, in get_note
  File "anki/rsbackend.py", line 265, in _run_command
anki.rsbackend.NotFoundError

```

You can only escape it by force closing Anki.

Version 2.1.30 (06a69c25)  
Python 3.8.0 Qt 5.14.2 PyQt 5.14.2  
macOS Catalina 10.15.5 (19F101)

I think the issue is:

1. `EditCurrent` pushes its active card onto the reviewers cardQueue
2. main window calls `self.reviewer.show()`
3. `show()` calls `next()`, which takes the topmost card from the cardQueue, which was already deleted by the browser

---

<div class="post-metadata">

**Author:** ![dae](https://sea2.discourse-cdn.com/flex002/user_avatar/forums.ankiweb.net/dae/32/65_2.png) [@dae](https://forums.ankiweb.net/u/dae)\
**Post date:** [August 11, 2020, 9:13am UTC](https://forums.ankiweb.net/t/bug-report-editor-updating-non-existing-card/2117/2 "2020-08-11T09:13:32Z")

</div>

Thanks for the report, I’ll look into this.

---

<div class="post-metadata">

**Author:** ![dae](https://sea2.discourse-cdn.com/flex002/user_avatar/forums.ankiweb.net/dae/32/65_2.png) [@dae](https://forums.ankiweb.net/u/dae)\
**Post date:** [August 17, 2020, 7:56am UTC](https://forums.ankiweb.net/t/bug-report-editor-updating-non-existing-card/2117/3 "2020-08-17T07:56:31Z")

</div>

Did you rule out add-ons? There is logic in the code to account for this already, and I can’t trigger it here.

---

<div class="post-metadata">

**Author:** ![hengiesel](https://sea2.discourse-cdn.com/flex002/user_avatar/forums.ankiweb.net/hengiesel/32/920_2.png) [@hengiesel](https://forums.ankiweb.net/u/hengiesel)\
**Post date:** [August 17, 2020, 8:53am UTC](https://forums.ankiweb.net/t/bug-report-editor-updating-non-existing-card/2117/4 "2020-08-17T08:53:23Z")

</div>

Hm, I could have sworn I deactivated all add-ons…

However, I tried it again, and I still get a notification to use “Tools \> Check Database”, and upon that I get

> Deleted ⁨1⁩ card with missing note.
> 
> Database rebuilt and optimized.

---

<div class="post-metadata">

**Author:** ![dae](https://sea2.discourse-cdn.com/flex002/user_avatar/forums.ankiweb.net/dae/32/65_2.png) [@dae](https://forums.ankiweb.net/u/dae)\
**Post date:** [August 17, 2020, 9:54am UTC](https://forums.ankiweb.net/t/bug-report-editor-updating-non-existing-card/2117/5 "2020-08-17T09:54:22Z")

</div>

I can’t reproduce the original issue, but can reproduce that and will fix it in the next update.

(please let me know if the former issue persists after updating)

---

<div class="post-metadata">

**Author:** ![hengiesel](https://sea2.discourse-cdn.com/flex002/user_avatar/forums.ankiweb.net/hengiesel/32/920_2.png) [@hengiesel](https://forums.ankiweb.net/u/hengiesel)\
**Post date:** [August 17, 2020, 10:29am UTC](https://forums.ankiweb.net/t/bug-report-editor-updating-non-existing-card/2117/6 "2020-08-17T10:29:12Z")

</div>

Okay thanks, and sorry for the inconvenience.

---

<div class="post-metadata">

**Author:** ![dae](https://sea2.discourse-cdn.com/flex002/user_avatar/forums.ankiweb.net/dae/32/65_2.png) [@dae](https://forums.ankiweb.net/u/dae)\
**Post date:** [August 17, 2020, 10:33am UTC](https://forums.ankiweb.net/t/bug-report-editor-updating-non-existing-card/2117/7 "2020-08-17T10:33:15Z")

</div>

Not a problem, thank you for the report!

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex002/uploads/anki2/original/1X/8f1279ababc5879d54e4838989f606cfe55af8c7.jpeg) [@system](https://forums.ankiweb.net/u/system)\
**Post date:** [May 1, 2023, 5:35am UTC](https://forums.ankiweb.net/t/bug-report-editor-updating-non-existing-card/2117/8 "2023-05-01T05:35:39Z")

</div>


