Skip to content

Commit 45514ac

Browse files
committed
CursorScene constructor null check
1 parent 8f5325d commit 45514ac

1 file changed

Lines changed: 10 additions & 6 deletions

File tree

cursorscene.ts

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ namespace user_interface_base {
1414
RecordData,
1515
DistributedLogging
1616
}
17-
17+
1818
export class CursorScene extends Scene {
1919
navigator: INavigator
2020
public cursor: Cursor
@@ -23,7 +23,11 @@ namespace user_interface_base {
2323
constructor(app: AppInterface, navigator?: INavigator) {
2424
super(app, "scene")
2525
this.backgroundColor = 11
26-
this.navigator = navigator
26+
27+
if (navigator)
28+
this.navigator = navigator
29+
else
30+
this.navigator = null
2731
}
2832

2933
protected moveCursor(dir: CursorDir) {
@@ -37,7 +41,7 @@ namespace user_interface_base {
3741
e.kind === FORWARD_BUTTON_ERROR_KIND
3842
)
3943
return
40-
else throw e
44+
else throw e
4145
}
4246
}
4347

@@ -151,14 +155,14 @@ namespace user_interface_base {
151155
}
152156
}
153157

154-
158+
155159
export class CursorSceneWithPriorPage extends CursorScene {
156160
private goBack1PageFn: () => void;
157161

158162
constructor(app: AppInterface, goBack1PageFn: () => void, navigator?: INavigator) {
159163
super(app)
160164
this.backgroundColor = 11
161-
165+
162166
if (navigator)
163167
this.navigator = navigator
164168
else
@@ -205,7 +209,7 @@ namespace user_interface_base {
205209
controller.B.id,
206210
() => this.back()
207211
)
208-
212+
209213
control.onEvent(
210214
ControllerButtonEvent.Pressed,
211215
controller.B.id,

0 commit comments

Comments
 (0)