Skip to content

Commit f541e2f

Browse files
authored
Merge pull request #528 from smartdevicelink/bugfix/present-alert-op-null-error
Fix null access error in _PresentAlertOperation
2 parents 5382a90 + 9c76ff5 commit f541e2f

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

lib/js/src/manager/screen/utils/_PresentAlertOperation.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -455,6 +455,13 @@ class _PresentAlertOperation extends _Task {
455455
* @returns {Boolean} - True if soft button images are supported, false if not.
456456
*/
457457
supportsSoftButtonImages () {
458+
if (this._currentWindowCapability === null
459+
|| this._currentWindowCapability === undefined
460+
|| this._currentWindowCapability.getSoftButtonCapabilities() === null
461+
|| this._currentWindowCapability.getSoftButtonCapabilities() === undefined
462+
|| this._currentWindowCapability.getSoftButtonCapabilities().length === 0) {
463+
return true; // return true if non-existant soft button capability
464+
}
458465
const softButtonCapabilities = this._currentWindowCapability.getSoftButtonCapabilities()[0];
459466
return softButtonCapabilities.getImageSupported();
460467
}

0 commit comments

Comments
 (0)