TaxonomyPickerControl: Uncaught TypeError: Cannot read property '0' of null

Jun 10, 2014 at 7:31 PM
Hi!

First of all thank you for a great contribution, really usefull tools you have provided here.

I have a small problem with the TaxonomyPickerControl, and I would be really happy if someone could put me in the right direction.

When I create a TaxonomyPicker as described and also when I use the Core.TaxonomyPicker project I get an error in the console "Uncaught TypeError: Cannot read property '0' of null" after some debugging I find that the property _dialog is null before the TermPickerControl is activated. I can start typing and get suggestions right away, but when I click outside the box it does not resolve the term but give this error.

If I click on the TermPickerControl and cancel it, the error disappears. So am I missing some initiation of the _dialog property or is this a bug?

Again thank you for your response

Regards
Jun 16, 2014 at 8:57 AM
I'm facing the same issue. It seems, that the _dialog will only be initialized if you open the terms dialog.
Here is my fix:
Replace:
!$.contains(this._dialog[0], event.target)
with:
(this._dialog === null || !$.contains(this._dialog[0], event.target))