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

Patch: node is null error when events from other frameworks creep into famous #468

Open
CompSciFutures opened this issue Aug 14, 2015 · 2 comments

Comments

@CompSciFutures
Copy link

Firefox 40.0 is generating "node is null" errors when events from other frameworks bubble into Famous (for example, from D3).

The attached patch to Famous#DOMRenderer._getPath() fixes it. It's a patch against the built famous.js but it should be clear where the required change is and its purpose should make sense just from looking at the code.

Grab me on slack if you need more info.

Index: WarRoom/lib/famous-20150801-622461886b5162f8dc42f91483b04d758b507d72.js
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- WarRoom/lib/famous-20150801-622461886b5162f8dc42f91483b04d758b507d72.js (revision 2ff2a6e3c886e5aca9b200d93c3d3159dd1f7430)
+++ WarRoom/lib/famous-20150801-622461886b5162f8dc42f91483b04d758b507d72.js (revision )
@@ -8993,7 +8993,7 @@
     // TODO move into _triggerEvent, avoid object allocation
     var path = [];
     var node = ev.target;
-    while (node !== document.body) {
+    while (node && node !== document.body) {
         path.push(node);
         node = node.parentNode;
     }

@alexanderGugel
Copy link
Member

Thanks. Do you want to submit a PR for this? Otherwise I'm going to fix this.

@CompSciFutures
Copy link
Author

Sorry I missed your note. Just fix it directly, its a one line change.

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

No branches or pull requests

2 participants