Skip to content

Commit 573bf27

Browse files
authored
Merge pull request #327 from smartdevicelink/bugfix/alignment-null-check
Add null/undefined check for text alignment
2 parents e77960f + 166544d commit 573bf27

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

lib/js/src/manager/screen/_TextAndGraphicUpdateOperation.js

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,10 @@ class _TextAndGraphicUpdateOperation extends _Task {
7878
this._finishOperation(false);
7979
return;
8080
}
81-
this._fullShow = new Show().setAlignment(this._updatedState.getTextAlignment());
81+
this._fullShow = new Show();
82+
if (this._updatedState.getTextAlignment() !== null && this._updatedState.getTextAlignment() !== undefined) {
83+
this._fullShow = this._fullShow.setAlignment(this._updatedState.getTextAlignment());
84+
}
8285
this._fullShow = this._assembleShowText(this._fullShow);
8386
this._fullShow = this._assembleShowImages(this._fullShow);
8487
this._fullShow = this._assembleLayout(this._fullShow);
@@ -529,7 +532,9 @@ class _TextAndGraphicUpdateOperation extends _Task {
529532
newShow.setMainField4(show.getMainField4());
530533
newShow.setTemplateTitle(show.getTemplateTitle());
531534
newShow.setMetadataTags(show.getMetadataTags());
532-
newShow.setAlignment(show.getAlignment());
535+
if (show.getAlignment() !== null && show.getAlignment() !== undefined) {
536+
newShow.setAlignment(show.getAlignment());
537+
}
533538

534539
if (this._showRpcSupportsTemplateConfiguration()) {
535540
newShow.setTemplateConfiguration(show.getTemplateConfiguration());

0 commit comments

Comments
 (0)