Skip to content

Commit 6d620d3

Browse files
committed
Fixes processing#1936 - nested constructor casts
Fixes processing#1936. Tokens can be null when Recognizer uses "guess" mode, which was not accounted for.
1 parent da8b281 commit 6d620d3

File tree

1 file changed

+4
-3
lines changed
  • app/src/processing/mode/java/preproc

1 file changed

+4
-3
lines changed

app/src/processing/mode/java/preproc/pde.g

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -194,13 +194,14 @@ constructorCast!
194194
// if this is a string literal, make sure the type we're trying to cast
195195
// to is one of the supported ones
196196
//
197-
{ #e.getType() != STRING_LITERAL ||
198-
( #t.getType() == LITERAL_byte ||
197+
{ (#e == null) ||
198+
( (#e.getType() != STRING_LITERAL) ||
199+
( #t.getType() == LITERAL_boolean ||
199200
#t.getType() == LITERAL_double ||
200201
#t.getType() == LITERAL_float ||
201202
#t.getType() == LITERAL_int ||
202203
#t.getType() == LITERAL_long ||
203-
#t.getType() == LITERAL_short ) }?
204+
#t.getType() == LITERAL_short )) }?
204205
// create the node
205206
//
206207
{#constructorCast = #(#[CONSTRUCTOR_CAST,"CONSTRUCTOR_CAST"], t, e);}

0 commit comments

Comments
 (0)