File tree Expand file tree Collapse file tree 2 files changed +7
-6
lines changed
src/main/java/org/zaproxy/zap/extension/neonmarker Expand file tree Collapse file tree 2 files changed +7
-6
lines changed Original file line number Diff line number Diff line change @@ -8,6 +8,9 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
8
8
- Maintenance changes.
9
9
- The script example in the Help content was updated to use the injected core variables instead of using the fully qualified class name.
10
10
11
+ ### Fixed
12
+ - An NPE which could happen when removing an entry that didn't yet have a tag assigned.
13
+
11
14
## [ 1.5.0] - 2022-07-11
12
15
### Added
13
16
- A right-click context menu is now available in the History tab in order to Select/Set a color for arbitrary messages.
Original file line number Diff line number Diff line change @@ -316,7 +316,7 @@ private Component getRemoveButton(int ruleNumber) {
316
316
return ;
317
317
}
318
318
String tag = colormap .get (ruleNumber ).getTag ();
319
- if (ExtensionNeonmarker .TAG_PATTERN .matcher (tag ).matches ()) {
319
+ if (tag != null && ExtensionNeonmarker .TAG_PATTERN .matcher (tag ).matches ()) {
320
320
switch (getRemovalChoice ()) {
321
321
case JOptionPane .CANCEL_OPTION :
322
322
case JOptionPane .CLOSED_OPTION :
@@ -332,19 +332,17 @@ private Component getRemoveButton(int ruleNumber) {
332
332
return ;
333
333
}
334
334
} else {
335
- colormap . remove (ruleNumber );
335
+ removeMapping (ruleNumber );
336
336
}
337
337
refreshDisplay ();
338
338
});
339
339
return remove ;
340
340
}
341
341
342
342
private void removeMapping (int ruleNumber ) {
343
- if ( colormap .size () == 1 ) {
344
- colormap .remove ( ruleNumber );
343
+ colormap .remove ( ruleNumber );
344
+ if ( colormap .isEmpty ()) {
345
345
colormap .add (new ExtensionNeonmarker .ColorMapping ());
346
- } else {
347
- colormap .remove (ruleNumber );
348
346
}
349
347
}
350
348
You can’t perform that action at this time.
0 commit comments