From: axelcl Date: Sun, 21 Aug 2005 11:57:24 +0000 (+0000) Subject: Bug #1248155: avoid NPE in parser X-Git-Url: http://git.phpeclipse.com Bug #1248155: avoid NPE in parser --- 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); } }