Skip to content

Commit c519c97

Browse files
committed
Error out in default Uploader with null Client IDs
1 parent ff6f79a commit c519c97

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

Assets/Thirdweb/Core/Scripts/Storage/StorageUploader.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,9 @@ public async Task<IPFSUploadResult> UploadText(string text)
3131

3232
public async Task<IPFSUploadResult> UploadFromPath(string path)
3333
{
34+
if (string.IsNullOrEmpty(ThirdwebManager.Instance.SDK.storage.ClientId))
35+
throw new UnityException("You cannot use default Upload features without setting a Client ID in the ThirdwebManager.");
36+
3437
// Get data
3538
byte[] bytes = System.IO.File.ReadAllBytes(path);
3639
WWWForm form = new WWWForm();

Assets/Thirdweb/Examples/Scripts/Prefabs/Prefab_Storage.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ public async void OnUpload()
2323
}
2424
catch (System.Exception e)
2525
{
26-
Debugger.Instance.Log("[Storage] Upload Error", $"Error uploading, make sure a Client ID is set: {e.Message}");
26+
Debugger.Instance.Log("[Storage] Upload Error", $"Error uploading: {e.Message}");
2727
}
2828
}
2929
}

0 commit comments

Comments
 (0)