Seaside
Seaside copied to clipboard
Squeak WAVNCController>>#renderContentOn: needs to test existence of a vnc server before asking if it is running
The current version of WAVNCController>>#renderContentOn: crashed because the RFBServer class return nil if there is no running instance. A simple change to test for nil first solves this -
renderContentOn: html
html heading: 'VNC Server'.
self serverInstance
ifNil: [self renderStartOn: html]
ifNotNil:
[self isServerRunning
ifTrue: [ self renderStopOn: html ]
ifFalse: [ self renderStartOn: html ]].
html heading: 'UI Process'.
self uiProcess isSuspended
ifFalse: [ self renderSuspendOn: html ]
ifTrue: [ self renderResumeOn: html ]
The RFBServer class also needs a small fix to provide an #isRunning method, but that is easy to solve and already committed in https://source.squeak.org/ss/RFB-tpr.23
Wouldn't it be better to do the nil check in #isServerRunning?
Yes, I do believe it would. Something like
isServerRunning
^ self serverInstance
ifNil: [false]
ifNotNil: [:srv| srv isRunning]
would probably be snesible. Or even 'sensible'.
~Also the access to the UI process needs to be changed to~ see #1386
Project current uiProcess