Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Uncaught TypeError: Cannot read property 'toLowerCase' of null #44

Open
gossi opened this issue Jan 28, 2018 · 3 comments
Open

Uncaught TypeError: Cannot read property 'toLowerCase' of null #44

gossi opened this issue Jan 28, 2018 · 3 comments

Comments

@gossi
Copy link

gossi commented Jan 28, 2018

I do get this error with v0.3.0, the mentioned line is:

const hasExecutionKeyMatch = eventExecutionKey.toLowerCase() === executionKey.toLowerCase();

@gossi gossi changed the title "Uncaught TypeError: Cannot read property 'toLowerCase' of null" Uncaught TypeError: Cannot read property 'toLowerCase' of null Jan 28, 2018
@gossi
Copy link
Author

gossi commented Jan 28, 2018

I was looping over my user defined hotkeys:

macros.push(manager.addMacro({
	executionKey: node.get('hotkey'),
	keyEvent: 'keydown',
	callback: () => {
		// ...
	}
}));

Some nodes didn't had a hotkey and most likely had null registering, should be prevent by an error message, I guess?

@jordpo
Copy link
Contributor

jordpo commented Jan 29, 2018

👍 on a warning message if no 'executionKey' is specified.

@jordpo
Copy link
Contributor

jordpo commented Jan 29, 2018

@gossi do you want to take a stab at it and follow the same pattern that we did here? https://github.com/IcarusWorks/ember-key-manager/blob/master/addon/services/key-manager.js#L61

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants