[[nbpython-commits]] [hg] main/contrib: 164823: NullPointerException at org.netbeans....

  • From: Tor Norbye < >
  • To:
  • Subject: [[nbpython-commits]] [hg] main/contrib: 164823: NullPointerException at org.netbeans....
  • Date: Thu, 21 Oct 2010 08:34:36 -0700

changeset 7e61afcd3348 in main/contrib
details: http://hg.netbeans.org/main/contrib?cmd=changeset;node=7e61afcd3348
description:
        164823: NullPointerException at 
org.netbeans.modules.python.editor.options.FmtOptions$CategorySupport.refreshPreview

diffstat:

 python.editor/src/org/netbeans/modules/python/editor/options/FmtOptions.java 
|  44 +++++----
 1 files changed, 23 insertions(+), 21 deletions(-)

diffs (56 lines):

diff --git 
a/python.editor/src/org/netbeans/modules/python/editor/options/FmtOptions.java
 
b/python.editor/src/org/netbeans/modules/python/editor/options/FmtOptions.java
--- 
a/python.editor/src/org/netbeans/modules/python/editor/options/FmtOptions.java
+++ 
b/python.editor/src/org/netbeans/modules/python/editor/options/FmtOptions.java
@@ -627,29 +627,31 @@
                         final PythonPlatformManager manager = 
PythonPlatformManager.getInstance();
                         final String platformName = 
manager.getDefaultPlatform();
                         PythonPlatform activePlatform = 
manager.getPlatform(platformName);
-                        roots.addAll(activePlatform.getUniqueLibraryRoots());
-                        ClassPath boot = 
ClassPathSupport.createClassPath(roots.toArray(new FileObject[roots.size()]));
-                        ClassPath source = 
ClassPathSupport.createClassPath(new FileObject[]{fo.getParent()});
-                        ClassPath compile = source;
+                        if (activePlatform != null) {
+                            
roots.addAll(activePlatform.getUniqueLibraryRoots());
+                            ClassPath boot = 
ClassPathSupport.createClassPath(roots.toArray(new FileObject[roots.size()]));
+                            ClassPath source = 
ClassPathSupport.createClassPath(new FileObject[]{fo.getParent()});
+                            ClassPath compile = source;
 
-                        ClasspathInfo cpInfo = ClasspathInfo.create(boot, 
compile, source);
-                        Source model = Source.create(cpInfo, fo);
-                        if (model != null) {
-                            final CompilationInfo[] infoHolder = new 
CompilationInfo[1];
-                            //model.runUserActionTask(new 
CancellableTask<CompilationInfo>() {
-                            model.runUserActionTask(new 
CancellableTask<CompilationController>() {
-                                public void cancel() {
-                                }
+                            ClasspathInfo cpInfo = 
ClasspathInfo.create(boot, compile, source);
+                            Source model = Source.create(cpInfo, fo);
+                            if (model != null) {
+                                final CompilationInfo[] infoHolder = new 
CompilationInfo[1];
+                                //model.runUserActionTask(new 
CancellableTask<CompilationInfo>() {
+                                model.runUserActionTask(new 
CancellableTask<CompilationController>() {
+                                    public void cancel() {
+                                    }
 
-                                //public void run(CompilationInfo info) 
throws Exception {
-                                public void run(CompilationController info) 
throws Exception {
-                                    info.toPhase(Phase.RESOLVED);
-                                    infoHolder[0] = info;
-                                    // Force open so info.getFileObject will 
succeed
-                                    GsfUtilities.getDocument(fo, true);
-                                }
-                            }, false);
-                            info = infoHolder[0];
+                                    //public void run(CompilationInfo info) 
throws Exception {
+                                    public void run(CompilationController 
info) throws Exception {
+                                        info.toPhase(Phase.RESOLVED);
+                                        infoHolder[0] = info;
+                                        // Force open so info.getFileObject 
will succeed
+                                        GsfUtilities.getDocument(fo, true);
+                                    }
+                                }, false);
+                                info = infoHolder[0];
+                            }
                         }
                     }
                 } catch (IOException ex) {

[[nbpython-commits]] [hg] main/contrib: 164823: NullPointerException at org.netbeans....

Tor Norbye 10/21/2010

Project Features

About this Project

www was started in November 2009, is owned by jpirek, and has 21 members.
By use of this website, you agree to the NetBeans Policies and Terms of Use (revision 20131025.e7cbc9d). © 2013, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo
 
 
Close
loading
Please Confirm
Close