avast / android-butterknife-zelezny

Android Studio plug-in for generating ButterKnife injections from selected layout XML.
Apache License 2.0
3.38k stars 412 forks source link

in version 1.6.0,has a java.lang.NullPointerException #137

Open edgargao opened 7 years ago

edgargao commented 7 years ago

java.lang.NullPointerException at com.avast.android.butterknifezelezny.model.Element.getFieldName(Element.java:73) at com.avast.android.butterknifezelezny.model.Element.(Element.java:43) at com.avast.android.butterknifezelezny.common.Utils$1.visitElement(Utils.java:208) at com.intellij.psi.XmlElementVisitor.visitXmlElement(XmlElementVisitor.java:22) at com.intellij.psi.XmlElementVisitor.visitXmlTag(XmlElementVisitor.java:54) at com.intellij.psi.impl.source.xml.XmlTagImpl.accept(XmlTagImpl.java:1076) at com.intellij.psi.impl.source.tree.CompositePsiElement.acceptChildren(CompositePsiElement.java:81) at com.intellij.psi.XmlRecursiveElementVisitor.visitElement(XmlRecursiveElementVisitor.java:37) at com.avast.android.butterknifezelezny.common.Utils$1.visitElement(Utils.java:170) at com.intellij.psi.XmlElementVisitor.visitXmlElement(XmlElementVisitor.java:22) at com.intellij.psi.XmlElementVisitor.visitXmlTag(XmlElementVisitor.java:54) at com.intellij.psi.impl.source.xml.XmlTagImpl.accept(XmlTagImpl.java:1076) at com.intellij.psi.impl.source.tree.CompositePsiElement.acceptChildren(CompositePsiElement.java:81) at com.intellij.psi.XmlRecursiveElementVisitor.visitElement(XmlRecursiveElementVisitor.java:37) at com.avast.android.butterknifezelezny.common.Utils$1.visitElement(Utils.java:170) at com.intellij.psi.XmlElementVisitor.visitXmlElement(XmlElementVisitor.java:22) at com.intellij.psi.XmlElementVisitor.visitXmlDocument(XmlElementVisitor.java:42) at com.intellij.psi.impl.source.xml.XmlDocumentImpl.accept(XmlDocumentImpl.java:90) at com.intellij.psi.impl.source.tree.SharedImplUtil.acceptChildren(SharedImplUtil.java:199) at com.intellij.psi.impl.source.PsiFileImpl.acceptChildren(PsiFileImpl.java:820) at com.intellij.psi.XmlRecursiveElementVisitor.visitElement(XmlRecursiveElementVisitor.java:37) at com.avast.android.butterknifezelezny.common.Utils$1.visitElement(Utils.java:170) at com.intellij.psi.PsiElementVisitor.visitFile(PsiElementVisitor.java:34) at com.intellij.psi.XmlRecursiveElementVisitor.visitFile(XmlRecursiveElementVisitor.java:55) at com.intellij.psi.XmlElementVisitor.visitXmlFile(XmlElementVisitor.java:26) at com.intellij.psi.impl.source.xml.XmlFileImpl.accept(XmlFileImpl.java:71) at com.avast.android.butterknifezelezny.common.Utils.getIDsFromLayout(Utils.java:166) at com.avast.android.butterknifezelezny.common.Utils.getIDsFromLayout(Utils.java:156) at com.avast.android.butterknifezelezny.InjectAction.actionPerformedImpl(InjectAction.java:73) at com.avast.android.butterknifezelezny.InjectAction.actionPerformed(InjectAction.java:58) at com.intellij.ui.popup.PopupFactoryImpl$ActionPopupStep.performAction(PopupFactoryImpl.java:861) at com.intellij.ui.popup.PopupFactoryImpl$ActionPopupStep$1.run(PopupFactoryImpl.java:847) at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:311) at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:756) at java.awt.EventQueue.access$500(EventQueue.java:97) at java.awt.EventQueue$3.run(EventQueue.java:709) at java.awt.EventQueue$3.run(EventQueue.java:703) at java.security.AccessController.doPrivileged(Native Method) at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:76) at java.awt.EventQueue.dispatchEvent(EventQueue.java:726) at com.intellij.ide.IdeEventQueue.defaultDispatchEvent(IdeEventQueue.java:857) at com.intellij.ide.IdeEventQueue._dispatchEvent(IdeEventQueue.java:658) at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.java:386) at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:201) at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:116) at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:105) at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101) at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:93) at java.awt.EventDispatchThread.run(EventDispatchThread.java:82)

edgargao commented 7 years ago

I hava a idea. becase in my layou xml file,id is android:id="@+id/hello$text" have a "$".