AssetPreview.GetAssetPreview always return null

Hi,

As the title says, AssetPreview.GetAssetPreview always return null. Why ?

			if (evt.type == EventType.DragPerform)
			{
				DragAndDrop.AcceptDrag ();
             
				foreach (UnityEngine.Object o in DragAndDrop.objectReferences)
				{
					GameObject go = o as GameObject;
					if (go)
					{
						Brick brick = go.GetComponent<Brick>();
						if (brick)
						{
							if (!Bricks.Contains(brick))
							{
								Texture2D tex = AssetPreview.GetAssetPreview(brick); //<------------------------------

//								while (tex == null) {}

//								tex.Resize(64, 64);
								AssetPreviews.Add(brick, tex);

								Debug.Log(brick.name + " dragged");
							} else Debug.LogError(o.name + " already added");
						} else Debug.LogError("Only Bricks can be added");
					} else Debug.LogError("Only GameObjects can be added");
				}
			}

I can’t see from your code anywhere in there that prove that this specific asset actually exist as a file inside the Assets folder.
Even worst, I doubt you could get the preview of a Component, as you cannot serialized a component individually.

The object exists as it’s dragged from the project view.
And it don’t even works with component’s gameobject, renderer, meshfilter, material, object or anything related and existing in this prefab I tried.

Now I do this in the OnInspectorGUI and it works fine :

GUIContent content = new GUIContent(AssetPreview.GetAssetPreview(brick.gameObject));