Seaside icon indicating copy to clipboard operation
Seaside copied to clipboard

Squeak WAVNCController>>#renderContentOn: needs to test existence of a vnc server before asking if it is running

Open timrowledge opened this issue 1 year ago • 2 comments

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

timrowledge avatar Dec 12 '23 01:12 timrowledge

Wouldn't it be better to do the nil check in #isServerRunning?

marschall avatar Jul 08 '24 07:07 marschall

Yes, I do believe it would. Something like

isServerRunning
	^ self serverInstance
		ifNil: [false]
		ifNotNil: [:srv| srv isRunning]

would probably be snesible. Or even 'sensible'.

timrowledge avatar Jul 08 '24 16:07 timrowledge

~Also the access to the UI process needs to be changed to~ see #1386

Project current uiProcess

marschall avatar Jun 30 '25 13:06 marschall