Sometimes happens to get a NullReferenceException in method:
public T MarshalJsValue<T>(JsInstance value)
The problem arises if the "value" parameter is null.
A brute workaround could be a check at the very beginning of the method (but I think that a deeper problem is involved somewhere else if that variable occurs to be "null"):
public T MarshalJsValue<T>(JsInstance value)
{
if (value == null)
{
T result = (T)Convert.ChangeType(null, typeof(T));
return result;
}