#183066: Preventing NPE.
authorJan Lahoda <jlahoda@netbeans.org>
Tue, 18 May 2010 15:13:04 +0200
changeset 163093c2c76607550
parent 16308 bf912db402d4
child 16310 02482aa4d55f
#183066: Preventing NPE.
javahints/src/org/netbeans/modules/javahints/OrganizeImports.java
     1.1 --- a/javahints/src/org/netbeans/modules/javahints/OrganizeImports.java	Mon May 17 11:04:06 2010 +0200
     1.2 +++ b/javahints/src/org/netbeans/modules/javahints/OrganizeImports.java	Tue May 18 15:13:04 2010 +0200
     1.3 @@ -89,7 +89,8 @@
     1.4  
     1.5      public List<ErrorDescription> run(CompilationInfo info, TreePath treePath) {
     1.6          try {
     1.7 -            if (GuardedSectionManager.getInstance((StyledDocument) info.getDocument()) != null) {
     1.8 +            StyledDocument doc = (StyledDocument) info.getDocument();
     1.9 +            if (doc == null || GuardedSectionManager.getInstance(doc) != null) {
    1.10                  return null;
    1.11              }
    1.12          } catch (IOException ex) {