From 82d18a9d2f2868ecc8e65b8520ce874ed9d23e06 Mon Sep 17 00:00:00 2001 From: axelcl Date: Sun, 21 Aug 2005 11:57:24 +0000 Subject: [PATCH] Bug #1248155: avoid NPE in parser --- .../phpdt/internal/compiler/parser/Parser.java | 12 ++++++++---- 1 files changed, 8 insertions(+), 4 deletions(-) diff --git a/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/internal/compiler/parser/Parser.java b/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/internal/compiler/parser/Parser.java index a048341..459987a 100644 --- a/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/internal/compiler/parser/Parser.java +++ b/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/internal/compiler/parser/Parser.java @@ -1803,7 +1803,7 @@ public class Parser implements ITerminalSymbols, CompilerModifiers, ParserBasicI new_elseif_list(iState); } finally { HashSet set = removeIfVariableSet(); - if (assignedVariableSet != null) { + if (assignedVariableSet != null && set != null) { assignedVariableSet.addAll(set); } } @@ -1816,7 +1816,9 @@ public class Parser implements ITerminalSymbols, CompilerModifiers, ParserBasicI if (assignedVariableSet != null) { HashSet topSet = peekVariableSet(); if (topSet != null) { - topSet.addAll(set); + if (set != null) { + topSet.addAll(set); + } topSet.addAll(assignedVariableSet); } } @@ -1852,7 +1854,7 @@ public class Parser implements ITerminalSymbols, CompilerModifiers, ParserBasicI elseif_list(iState); } finally { HashSet set = removeIfVariableSet(); - if (assignedVariableSet != null) { + if (assignedVariableSet != null && set != null) { assignedVariableSet.addAll(set); } } @@ -1865,7 +1867,9 @@ public class Parser implements ITerminalSymbols, CompilerModifiers, ParserBasicI if (assignedVariableSet != null) { HashSet topSet = peekVariableSet(); if (topSet != null) { - topSet.addAll(set); + if (set != null) { + topSet.addAll(set); + } topSet.addAll(assignedVariableSet); } } -- 1.7.1