Skip to content

Commit 16df8f4

Browse files
committed
Bug: warning "Null pointer access: The variable action can only be null at this location"
1 parent f02eb2a commit 16df8f4

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

sources/net.sf.j2s.ui/src/net/sf/j2s/ui/console/J2SViewImages.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,9 @@ public class J2SViewImages {
3939

4040
public static void setImageDescriptors(IAction action, String type) {
4141
if (action == null) {
42+
return;
43+
}
44+
4245
try {
4346
ImageDescriptor id= ImageDescriptor.createFromURL(makeIconFileURL("d", type)); //$NON-NLS-1$
4447
if (id != null)
@@ -52,7 +55,7 @@ public static void setImageDescriptors(IAction action, String type) {
5255
action.setHoverImageDescriptor(id);
5356
} catch (MalformedURLException e) {
5457
}
55-
}
58+
5659
action.setImageDescriptor(create("e", type)); //$NON-NLS-1$
5760
}
5861

0 commit comments

Comments
 (0)