[Pydev-cvs] org.python.pydev.debug/src/org/python/pydev/debug/model XMLUtils.java,1.3,1.4
Brought to you by:
fabioz
From: Aleksandar T. <at...@us...> - 2004-09-23 22:16:10
|
Update of /cvsroot/pydev/org.python.pydev.debug/src/org/python/pydev/debug/model In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29122/src/org/python/pydev/debug/model Modified Files: XMLUtils.java Log Message: Fix null dereference, bug 1028530 Index: XMLUtils.java =================================================================== RCS file: /cvsroot/pydev/org.python.pydev.debug/src/org/python/pydev/debug/model/XMLUtils.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** XMLUtils.java 17 May 2004 20:17:15 -0000 1.3 --- XMLUtils.java 23 Sep 2004 22:15:53 -0000 1.4 *************** *** 152,156 **** currentFrame = thread.findStackFrameByID(id);; if (currentFrame == null) ! currentFrame = new PyStackFrame(thread, id, name, filePath, Integer.parseInt(line)); else { currentFrame.setName(name); --- 152,156 ---- currentFrame = thread.findStackFrameByID(id);; if (currentFrame == null) ! currentFrame = new PyStackFrame(thread, id, name, filePath, Integer.parseInt(line)); else { currentFrame.setName(name); *************** *** 161,172 **** } // local variables belong to the stack frame // when private void startVar(Attributes attributes) { ! if (locals == null) { ! locals = new ArrayList(); ! PyVariableCollection global = new PyVariableCollection(target, "Globals", "frame.f_global", "Global variables", currentFrame.getGlobalLocator()); ! locals.add(global); // locals always include global as the top ! } // create a local variable, and add it to locals PyVariable newLocal = createVariable(target, currentFrame.getLocalsLocator(), attributes); --- 161,175 ---- } + private void initializeLocals() { + locals = new ArrayList(); + PyVariableCollection global = new PyVariableCollection(target, "Globals", "frame.f_global", "Global variables", currentFrame.getGlobalLocator()); + locals.add(global); // locals always include global as the top + } + // local variables belong to the stack frame // when private void startVar(Attributes attributes) { ! if (locals == null) ! initializeLocals(); // create a local variable, and add it to locals PyVariable newLocal = createVariable(target, currentFrame.getLocalsLocator(), attributes); *************** *** 201,204 **** --- 204,209 ---- if (qName.equals("frame")) { // when frame ends, we need to assign all the local variables + if (locals == null) + initializeLocals(); IVariable[] locArry = new IVariable[locals.size()]; for (int i=0; i < locArry.length; i++) |