anki-editor icon indicating copy to clipboard operation
anki-editor copied to clipboard

Wrong type argument: integer-or-marker-p, nil (develop branch)

Open bitozoid opened this issue 5 years ago • 2 comments

I was getting an error until I upgraded anki-editor to https://github.com/leoc/anki-editor/commit/c68beb4439105e1b2ddb10ae7f9b27c2614f1594.

Then, I got a new error imho motivated from commit b2cbf48911556a33809cc4211bfc5f9a89cd797e (develop branch of this repo):

ANKI_FAILURE_REASON: Wrong type argument: integer-or-marker-p, nil

After some debugging, it looks that the new code from b2cbf48911556a33809cc4211bfc5f9a89cd797e (refactor of anki-editor--build-fields) can not handle empty fields.

As a workaround, I have set just a dash (-) as field value, but I think this should be fixed.

bitozoid avatar Mar 08 '21 18:03 bitozoid

As a matter of fact, I've realized that I cannot push cards with a "reverse" empty field.

bitozoid avatar Mar 11 '21 14:03 bitozoid

As a new workaround, I decided to remove headers of empty fields so I get no error. However, that does not empty the field in Anki, but preserves its current Anki value.

EDIT: [...] However, that does not empty the field in Anki. Indeed, it may set the value of the field to the upper org header.

bitozoid avatar Mar 21 '21 21:03 bitozoid