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

Error with "status label" #2

Closed
dcconner opened this issue Mar 3, 2017 · 2 comments
Closed

Error with "status label" #2

dcconner opened this issue Mar 3, 2017 · 2 comments
Assignees

Comments

@dcconner
Copy link
Member

dcconner commented Mar 3, 2017

Running the example_behavior with App version 2.0.1

chrome-extension://bkpceecdjoihccpjecmbafbjifpefbad/src/ui/ui_runtimecontrol.js:113
		status_label = R.text(R.width / 2, R.height - 30, text)
		                ^

TypeError: Cannot read property 'text' of undefined

    at drawStatusLabel (chrome-extension://bkpceecdjoihccpjecmbafbjifpefbad/src/ui/ui_runtimecontrol.js:113:19)
    at Object.UI.RuntimeControl.displayOutcomeRequest (chrome-extension://bkpceecdjoihccpjecmbafbjifpefbad/src/ui/ui_runtimecontrol.js:721:4)
    at outcome_request_callback (chrome-extension://bkpceecdjoihccpjecmbafbjifpefbad/src/rc/rc_pubsub.js:44:21)
    at process.nextTick (chrome-extension://bkpceecdjoihccpjecmbafbjifpefbad/src/ros/ros_subscriber.js:50:59)

In method src/ui/ui_runtimecontrol.js at L111

	var drawStatusLabel = function(text) {
		if (status_label != undefined) status_label.remove();
		status_label = R.text(R.width / 2, R.height - 30, text)
			.attr({'font-size': 16, 'fill': 'gray'});
	}

There is no protection against R being undefined and needing to initialized

@dcconner
Copy link
Member Author

dcconner commented Mar 3, 2017

I should note this does not always happen, but I have seen this error multiple times on different statemachines

@pschillinger
Copy link
Member

Looks like there is a race condition causing this error if an outcome request is processed before the state display is actually drawn. I will check.

@pschillinger pschillinger self-assigned this Mar 3, 2017
alireza-hosseini added a commit to alireza-hosseini/flexbe_app that referenced this issue Jun 13, 2018
…ckage (FlexBE#2)

* feat: Add `nw` as module dependency
 - Add a start command to execute the app using nw

* feat: Use `npm start` to run the app

* build: Properly install required files
 - These installations were required to distribute the app as a
 debian package
 - Now the nw will be installed by npm in addition to other dependencies

* conf: Add dependency to `npm`
 - Increase version
 - Change package.xml format to version 2

* conf: add missing dependencies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants