# LockIsValid(AssetList)

> Returns true if the Provider.Lock task can be executed on one or more assets from the given asset list.

## Definition

* **Type:** Method
* **Namespace:** [UnityEditor.VersionControl](/engine/6000.5/script-reference/unityeditor/versioncontrol.md)
* **Assembly:** UnityEditor.CoreModule

```csharp
public static bool LockIsValid(AssetList assets)
```

### Parameters

**** (\[AssetList]\(/engine/6000.5/script-reference/unityeditor/versioncontrol/assetlist)): List of assets to test.

### Returns

| Type                                                          | Description |
| ------------------------------------------------------------- | ----------- |
| [bool](https://learn.microsoft.com/dotnet/api/system.boolean) |             |

### Examples

```csharp
using System.Collections.Generic;
using UnityEditor;
using UnityEditor.VersionControl;
using UnityEngine;

public class EditorScript : MonoBehaviour
{
    [MenuItem("Version Control/LockIsValid")]
    public static void ExampleLockIsValid()
    {
        AssetList assets = new AssetList();
        assets.Add(Provider.GetAssetByPath("Assets/ExampleAsset.cs"));
        Debug.Log("LockIsvalid?  " + Provider.LockIsValid(assets));
    }
}
```
