Skip to content
Snippets Groups Projects
Commit eece5547 authored by jojohoch's avatar jojohoch
Browse files

[player] Consider initialization of properties with null

parent 0fa4d8a9
No related branches found
No related tags found
No related merge requests found
...@@ -2,7 +2,7 @@ import { FormControl, FormGroup, ValidatorFn } from '@angular/forms'; ...@@ -2,7 +2,7 @@ import { FormControl, FormGroup, ValidatorFn } from '@angular/forms';
export interface ValueChangeElement { export interface ValueChangeElement {
id: string; id: string;
values: [string | number | boolean | undefined, string | number | boolean]; values: [string | number | boolean | null | undefined, string | number | boolean];
} }
export interface FormControlElement { export interface FormControlElement {
......
...@@ -29,7 +29,7 @@ export interface PlayerConfig { ...@@ -29,7 +29,7 @@ export interface PlayerConfig {
export interface UnitStateElementCode { export interface UnitStateElementCode {
id: string; id: string;
status: UnitStateElementCodeStatus; status: UnitStateElementCodeStatus;
value: string | string[] | number | boolean | undefined; value: string | number | boolean | null;
} }
export interface UnitState { export interface UnitState {
......
...@@ -22,7 +22,7 @@ export class UnitStateService { ...@@ -22,7 +22,7 @@ export class UnitStateService {
.find((elementCode: UnitStateElementCode): boolean => elementCode.id === id); .find((elementCode: UnitStateElementCode): boolean => elementCode.id === id);
} }
setUnitStateElementCodeValue(id: string, value: string | number | boolean | undefined): void { setUnitStateElementCodeValue(id: string, value: string | number | boolean | null): void {
const unitStateElementCode = this.getUnitStateElement(id); const unitStateElementCode = this.getUnitStateElement(id);
if (unitStateElementCode) { if (unitStateElementCode) {
unitStateElementCode.value = value; unitStateElementCode.value = value;
...@@ -71,7 +71,7 @@ export class UnitStateService { ...@@ -71,7 +71,7 @@ export class UnitStateService {
this.setUnitStateElementCodeStatus(elementStatus.id, elementStatus.status); this.setUnitStateElementCodeStatus(elementStatus.id, elementStatus.status);
} }
private addUnitStateElementCode(id: string, value: string | number | boolean | string[] | undefined): void { private addUnitStateElementCode(id: string, value: string | number | boolean | null): void {
if (!this.getUnitStateElement(id)) { if (!this.getUnitStateElement(id)) {
const unitStateElementCode: UnitStateElementCode = { id: id, value: value, status: 'NOT_REACHED' }; const unitStateElementCode: UnitStateElementCode = { id: id, value: value, status: 'NOT_REACHED' };
this.unitStateElementCodes.push(unitStateElementCode); this.unitStateElementCodes.push(unitStateElementCode);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment