Skip to content

Commit

Permalink
Merge pull request SmartBear#315 from stranljip/next
Browse files Browse the repository at this point in the history
fix problem with NullPointerException while adding assertions in MacOS
  • Loading branch information
ReadyAPIAgent authored May 23, 2018
2 parents d73fe7f + 012430a commit f1c1c4a
Showing 1 changed file with 21 additions and 11 deletions.
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
/*
* SoapUI, Copyright (C) 2004-2017 SmartBear Software
*
* Licensed under the EUPL, Version 1.1 or - as soon as they will be approved by the European Commission - subsequent
* versions of the EUPL (the "Licence");
* You may not use this work except in compliance with the Licence.
* You may obtain a copy of the Licence at:
*
* http://ec.europa.eu/idabc/eupl
*
* Unless required by applicable law or agreed to in writing, software distributed under the Licence is
* distributed on an "AS IS" basis, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
* express or implied. See the Licence for the specific language governing permissions and limitations
* under the Licence.
* Licensed under the EUPL, Version 1.1 or - as soon as they will be approved by the European Commission - subsequent
* versions of the EUPL (the "Licence");
* You may not use this work except in compliance with the Licence.
* You may obtain a copy of the Licence at:
*
* http://ec.europa.eu/idabc/eupl
*
* Unless required by applicable law or agreed to in writing, software distributed under the Licence is
* distributed on an "AS IS" basis, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
* express or implied. See the Licence for the specific language governing permissions and limitations
* under the Licence.
*/

package com.eviware.soapui.impl.wsdl.panels.assertions;
Expand Down Expand Up @@ -401,6 +401,10 @@ public void setAssertable(Assertable assertable) {
public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus,
int row, int column) {

if (value == null) {
return super.getTableCellRendererComponent(table, value, isSelected, hasFocus, row, column);
}

boldFont = getFont().deriveFont(Font.BOLD);

AssertionListEntry entry = (AssertionListEntry) value;
Expand Down Expand Up @@ -468,10 +472,16 @@ public void setAssertable(Assertable assertable) {
@Override
public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus,
int row, int column) {

if (value == null) {
return super.getTableCellRendererComponent(table, value, isSelected, hasFocus, row, column);
}

String categoryName = (String) value;
boolean disabled = true;
Font boldFont = getFont().deriveFont(Font.BOLD);
SortedSet<AssertionListEntry> assertions = categoriesAssertionsMap.get(categoryName);

for (AssertionListEntry assertionListEntry : assertions) {
if (isAssertionApplicable(assertionListEntry.getTypeId())) {
disabled = false;
Expand Down

0 comments on commit f1c1c4a

Please sign in to comment.