You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The virtual machine shuts down when reading from a null item from an array.
Example code:
using System;
using System.Collections.Generic;
using System.Text;
using Sys = Cosmos.System;
namespace CosmosWeirdError
{
public class Kernel : Sys.Kernel
{
MyClass[] SomeArray = new MyClass[2];
protected override void BeforeRun()
{
try
{
Console.WriteLine("Cosmos booted successfully. Type a line of text to get it echoed back.");
//This should cause a null refrence expection, but instead the VM shuts down or shows a random value
Console.WriteLine(SomeArray[1].SomeValue);
}
catch(Exception x)
{
Console.WriteLine(x.Message);
}
}
protected override void Run()
{
Console.Write("Input: ");
var input = Console.ReadLine();
Console.Write("Text typed: ");
Console.WriteLine(input);
}
}
public class MyClass
{
public byte SomeValue;
}
}
The text was updated successfully, but these errors were encountered:
The virtual machine shuts down when reading from a null item from an array.
Example code:
The text was updated successfully, but these errors were encountered: