#183066: Preventing NPE.
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) {