@@ -205,22 +205,31 @@ private void generateAlterStatementsFor(
205205 // Look for differences in storedColumnList
206206 // Easiest is to use Maps.difference, but first we need some maps, and we need to preserve order
207207 // so convert the keyParts to String, and then add to a LinkedHashMap.
208+ ASTstored_column_list origStoredColList =
209+ getOptionalChildByType (original .children , ASTstored_column_list .class );
208210 Map <String , ASTstored_column > originalStoredColumns =
209- getChildByType (original .children , ASTstored_column_list .class ).getStoredColumns ().stream ()
210- .collect (
211- Collectors .toMap (
212- ASTstored_column ::toString ,
213- Function .identity (),
214- (x , y ) -> y ,
215- LinkedHashMap ::new ));
211+ origStoredColList == null
212+ ? Map .of ()
213+ : origStoredColList .getStoredColumns ().stream ()
214+ .collect (
215+ Collectors .toMap (
216+ ASTstored_column ::toString ,
217+ Function .identity (),
218+ (x , y ) -> y ,
219+ LinkedHashMap ::new ));
220+
221+ ASTstored_column_list newStoredColList =
222+ getOptionalChildByType (other .children , ASTstored_column_list .class );
216223 Map <String , ASTstored_column > newStoredColumns =
217- getChildByType (other .children , ASTstored_column_list .class ).getStoredColumns ().stream ()
218- .collect (
219- Collectors .toMap (
220- ASTstored_column ::toString ,
221- Function .identity (),
222- (x , y ) -> y ,
223- LinkedHashMap ::new ));
224+ newStoredColList == null
225+ ? Map .of ()
226+ : newStoredColList .getStoredColumns ().stream ()
227+ .collect (
228+ Collectors .toMap (
229+ ASTstored_column ::toString ,
230+ Function .identity (),
231+ (x , y ) -> y ,
232+ LinkedHashMap ::new ));
224233 MapDifference <String , ASTstored_column > storedColDiff =
225234 Maps .difference (originalStoredColumns , newStoredColumns );
226235
0 commit comments