Skip to content

Commit 63293af

Browse files
addison74kiatng
andauthored
Fixed null parameter warning in DataFlow Profiles (#3827)
Co-authored-by: Ng Kiat Siong <[email protected]>
1 parent fef1c08 commit 63293af

File tree

3 files changed

+3
-12
lines changed

3 files changed

+3
-12
lines changed

app/code/core/Mage/Adminhtml/Block/System/Convert/Gui/Edit/Tab/Wizard.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ public function getValue($key, $default = '', $defaultNew = null)
9292
}
9393

9494
$value = $this->getData($key);
95-
return $this->escapeHtml(strlen($value) > 0 ? $value : $default);
95+
return $this->escapeHtml($value !== null && strlen($value) > 0 ? $value : $default);
9696
}
9797

9898
/**

app/code/core/Mage/Dataflow/Model/Profile.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,8 @@ protected function _beforeSave()
8686
{
8787
parent::_beforeSave();
8888
$actionsXML = $this->getData('actions_xml');
89-
if (strlen($actionsXML) < 0 &&
89+
// @phpstan-ignore-next-line because of https://github.com/phpstan/phpstan/issues/10570
90+
if ($actionsXML !== null && strlen($actionsXML) < 0 &&
9091
@simplexml_load_string('<data>' . $actionsXML . '</data>', null, LIBXML_NOERROR) === false
9192
) {
9293
Mage::throwException(Mage::helper('dataflow')->__("Actions XML is not valid."));

phpstan.dist.baseline.neon

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2915,16 +2915,6 @@ parameters:
29152915
count: 1
29162916
path: app/code/core/Mage/Dataflow/Model/Convert/Profile/Abstract.php
29172917

2918-
-
2919-
message: "#^Comparison operation \"\\<\" between int\\<0, max\\> and 0 is always false\\.$#"
2920-
count: 1
2921-
path: app/code/core/Mage/Dataflow/Model/Profile.php
2922-
2923-
-
2924-
message: "#^Result of && is always false\\.$#"
2925-
count: 1
2926-
path: app/code/core/Mage/Dataflow/Model/Profile.php
2927-
29282918
-
29292919
message: "#^Right side of && is always true\\.$#"
29302920
count: 1

0 commit comments

Comments
 (0)