Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
timrowledge opened this issue Dec 12, 2023 · 2 comments

Comments

@timrowledge
Copy link

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

@marschall
Copy link
Contributor

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

@timrowledge
Copy link
Author

Yes, I do believe it would.
Something like

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

would probably be snesible. Or even 'sensible'.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants