Skip to content

Commit 98e1775

Browse files
committed
Remove redundant checks
1 parent 0b4968a commit 98e1775

1 file changed

Lines changed: 6 additions & 10 deletions

File tree

src/io/flutter/actions/DeviceSelectorAction.java

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -121,12 +121,10 @@ public Dimension getPreferredSize() {
121121
height = Math.max(height, icon.getIconHeight());
122122
}
123123
else if (iconLabel == null) {
124-
// Fallback: use default mobile icon size when component is not fully initialized
124+
// Fallback: use the default mobile icon size when the component is not fully initialized
125125
Icon defaultIcon = FlutterIcons.Mobile;
126-
if (defaultIcon != null) {
127-
width += defaultIcon.getIconWidth();
128-
height = Math.max(height, defaultIcon.getIconHeight());
129-
}
126+
width += defaultIcon.getIconWidth();
127+
height = Math.max(height, defaultIcon.getIconHeight());
130128
}
131129

132130
if (textLabel instanceof JBLabel label && label.getText() instanceof String text && !text.isEmpty()) {
@@ -150,12 +148,10 @@ else if (textLabel == null) {
150148
height = Math.max(height, icon.getIconHeight());
151149
}
152150
else if (arrowLabel == null) {
153-
// Fallback: use default chevron down icon size
151+
// Fallback: use the default chevron down icon size
154152
Icon defaultArrow = IconUtil.scale(AllIcons.General.ChevronDown, null, 1.2f);
155-
if (defaultArrow != null) {
156-
width += defaultArrow.getIconWidth();
157-
height = Math.max(height, defaultArrow.getIconHeight());
158-
}
153+
width += defaultArrow.getIconWidth();
154+
height = Math.max(height, defaultArrow.getIconHeight());
159155
}
160156

161157
width += JBUI.scale(24);

0 commit comments

Comments
 (0)