File tree Expand file tree Collapse file tree 1 file changed +10
-0
lines changed
src/main/java/com/cedricziel/idea/typo3/extbase/persistence Expand file tree Collapse file tree 1 file changed +10
-0
lines changed Original file line number Diff line number Diff line change @@ -81,6 +81,7 @@ public PhpType getType(PsiElement psiElement) {
8181 return null ;
8282 }
8383
84+ @ Nullable
8485 private Field extractFieldFromGetter (MethodReference methodReference ) {
8586 String name = methodReference .getName ();
8687 if (name == null ) {
@@ -89,6 +90,10 @@ private Field extractFieldFromGetter(MethodReference methodReference) {
8990
9091 String substring = name .substring (2 );
9192 char [] cArr = substring .toCharArray ();
93+ if (cArr .length == 0 ) {
94+ return null ;
95+ }
96+
9297 cArr [0 ] = Character .toLowerCase (cArr [0 ]);
9398
9499 String propertyName = new String (cArr );
@@ -107,9 +112,14 @@ private Field extractFieldFromGetter(MethodReference methodReference) {
107112 return containingClass .findFieldByName (propertyName , true );
108113 }
109114
115+ @ Nullable
110116 private Field extractFieldFromGetter (Method method ) {
111117 String substring = method .getName ().substring (3 );
112118 char [] cArr = substring .toCharArray ();
119+ if (cArr .length == 0 ) {
120+ return null ;
121+ }
122+
113123 cArr [0 ] = Character .toLowerCase (cArr [0 ]);
114124
115125 String propertyName = new String (cArr );
You can’t perform that action at this time.
0 commit comments