Hello! Im trying to download a simple text file from github here using the WWW API but its not working and throwing this error: Code (CSharp): NullReferenceException: (null) UnityEditor.SerializedObject..ctor (UnityEngine.Object[] objs, UnityEngine.Object context) (at C:/buildslave/unity/build/artifacts/generated/common/editor/SerializedPropertyBindings.gen.cs:87) UnityEditor.Editor.GetSerializedObjectInternal () (at C:/buildslave/unity/build/artifacts/generated/common/editor/EditorBindings.gen.cs:193) UnityEditor.Editor.get_serializedObject () (at C:/buildslave/unity/build/artifacts/generated/common/editor/EditorBindings.gen.cs:185) UnityEditor.MaterialEditor.OnEnable () (at C:/buildslave/unity/build/Editor/Mono/Inspector/MaterialEditor.cs:1773) And my code is: Code (CSharp): using System.Collections; using System.Collections.Generic; using UnityEngine; using UnityEngine.UI; public class LogUpdater : MonoBehaviour { public string url = "https://gist.githubusercontent.com/Proxz/27d9a6bc8b4e2b39a0063e66db4dfe90/raw/1c3bb5889cc41d8e719993ea0d38b6e5e403ce75/conradupdate.txt"; public string recived = ""; public byte[] test; void Start() { StartCoroutine(DownloadLog()); } IEnumerator DownloadLog() { WWW www = new WWW(url); yield return www; Text text = GetComponent<Text>(); text.text = www.text; recived = www.text; } } Im pretty sure its because the url dosn't contain "www." but I dont know a solution. Please help thank you
The code snippet is most-likely not involved. Check the stack-trace, which indicates that the error happens during OnEnable in the material editor. This may be a bug on Unity's side.
That might be coincidence. Have you tried to step-through using the debugger? As mentioned, the error originates in the MaterialEditor. Also, which version are you using? A quick search brought up similar issues that also originated in the same file, some of them should have been fixed in recent versions and only occured in particular situations.