Throw exception if ContentFolder doesn't exist or is empty

This commit is contained in:
Garry Newman 2020-05-07 11:05:37 +01:00
parent 0beaeb2e9d
commit c10167bb91

View File

@ -96,6 +96,19 @@ namespace Steamworks.Ugc
if ( consumerAppId == 0 )
consumerAppId = SteamClient.AppId;
//
// Checks
//
if ( ContentFolder != null )
{
if ( !System.IO.Directory.Exists( ContentFolder.FullName ) )
throw new System.Exception( $"UgcEditor - Content Folder doesn't exist ({ContentFolder.FullName})" );
if ( !ContentFolder.EnumerateFiles( "*", System.IO.SearchOption.AllDirectories ).Any() )
throw new System.Exception( $"UgcEditor - Content Folder is empty" );
}
//
// Item Create
//