#192816 avoid NullPointerException release81_base
authorJulien Enselme <jenselme@netbeans.org>
Tue, 29 Sep 2015 17:48:26 +0200
changeset 18327dfeab4f40dfd
parent 18326 b193ea00889f
child 18328 4f0fd56d0966
child 18329 a73625ffa3da
#192816 avoid NullPointerException

Check that context is not null before using it. This prevents the exception from
occuring. However, the parameters are not taken into account.
python.source/src/org/netbeans/modules/python/source/PythonFormatter.java
     1.1 --- a/python.source/src/org/netbeans/modules/python/source/PythonFormatter.java	Fri Sep 25 01:31:00 2015 -0500
     1.2 +++ b/python.source/src/org/netbeans/modules/python/source/PythonFormatter.java	Tue Sep 29 17:48:26 2015 +0200
     1.3 @@ -409,7 +409,7 @@
     1.4                              computedIndent = 0;
     1.5                          }
     1.6  
     1.7 -                        if (computedIndent != indent) {
     1.8 +                        if (computedIndent != indent && context != null) {
     1.9                              try {
    1.10                                  context.modifyIndent(offset, computedIndent);
    1.11                              } catch (BadLocationException ex) {