Answer the question
In order to leave comments, you need to log in
How to solve Cannot access child value on Newtonsoft.Json.Linq.JValue error?
Good day!
I have JSON data, I output it like this:
foreach( var data in JSON ) {
if ( data != null ) {
var count = data["count"];
//дальше код
}
}
var count = data["count"];
Cannot access child value on Newtonsoft.Json.Linq.JValue
if ( data["count"] != null ) { /* дальше код */ }
Answer the question
In order to leave comments, you need to log in
If you show your JSON, it will be clearer.
Judging by JValue
, in one of your cases data
it becomes not an object with nested properties, but a primitive type (for example, a number or a string).
Perhaps this is an error in the formation of the data that you are processing. If you receive data from outside and this situation is acceptable, then instead data["count"] != null
put a check on data is JObject
.
The point is DPMS (Display Power Management Signaling), which cuts off the monitor in order to save energy.
You can check its operation using xset -q, the output will be something like this:
DPMS (Energy Star):
Standby: 0 Suspend: 0 Off: 0
DPMS is Enabled
Monitor is On
You can disable it with:
xset -dpms; xset s off
( in fact, turn off dpms and screen power saving mode)
* the settings are valid only for the current session, so if you do not need power saving, you can set the command to autoload, or manually execute the command each time at the start of work.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question