From 2f5eb605fe23cd231db38622ad7d0a0a0a3044d2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jindra=20Pet=C5=99=C3=ADk?= Date: Mon, 29 Nov 2021 07:08:23 +0100 Subject: [PATCH] Fixed AS1/2 - empty parenthesis nullpointer --- CHANGELOG.md | 1 + .../flash/action/parser/script/ActionScript2Parser.java | 7 +++++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 136792d77..039a46805 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -48,6 +48,7 @@ All notable changes to this project will be documented in this file. - AS1/2 - deobfuscate object literal names - AS1/2 - spacing in with statement - Playercontrols frame display incorrect frame +- AS1/2 - empty parenthesis nullpointer ## [14.6.0] - 2021-11-22 ### Added diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/parser/script/ActionScript2Parser.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/parser/script/ActionScript2Parser.java index d0c734c7c..d42ac8196 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/parser/script/ActionScript2Parser.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/parser/script/ActionScript2Parser.java @@ -1891,9 +1891,12 @@ public class ActionScript2Parser { break; case PARENT_OPEN: - ret = new ParenthesisItem(null, null, expression(inFunction, inMethod, inTellTarget, true, variables, functions, true, hasEval)); + GraphTargetItem pexpr = expression(inFunction, inMethod, inTellTarget, true, variables, functions, true, hasEval); + if (pexpr == null) { + throw new ActionParseException("Expression expected", lexer.yyline()); + } + ret = new ParenthesisItem(null, null, pexpr); expectedType(SymbolType.PARENT_CLOSE); - //ret = memberOrCall(ret, inFunction, inMethod, variables, functions); allowMemberOrCall = true; break; case NEW: