{"record":{"id":"1350f2583def58d0","repo":"Unity-Technologies/UnityCsReference","slug":"clip-clip-s-overview-preview-is-null","errorCode":null,"errorMessage":"Clip {clip}'s overview preview is null","messagePattern":"Clip (.+?)'s overview preview is null","errorType":"validation","errorClass":"ArgumentException","httpStatus":null,"severity":"error","filePath":"Editor/Mono/Audio/StreamedAudioClipPreview.cs","lineNumber":71,"sourceCode":"            {\n                if (size < 2)\n                    throw new ArgumentException(\"Size has to be larger than 1\");\n\n                if (localLength <= 0)\n                    throw new ArgumentException(\"length has to be longer than zero\", \"localLength\");\n\n                if (localStart < 0)\n                    throw new ArgumentException(\"localStart has to be positive\", \"localStart\");\n\n                if (clip == null)\n                    throw new ArgumentNullException(\"clip\");\n\n                this.clip = clip;\n\n                preview = AudioClipMinMaxOverview.GetOverviewFor(clip);\n\n                if (preview == null)\n                    throw new ArgumentException(\"Clip \" + clip + \"'s overview preview is null\");\n\n                looping = isLooping;\n\n                this.localStart = localStart;\n                this.localLength = localLength;\n\n                if (looping)\n                {\n                    previewPixelsToRender = size;\n                }\n                else\n                {\n                    var clampedLength = Math.Min(clip.length - localStart, localLength);\n                    previewPixelsToRender = (int)Math.Min(size, size * Math.Max(0, clampedLength / localLength));\n                }\n\n                previewSamples = preview.Length / (clip.channels * 2);\n                normalizedDuration = localLength / clip.length;","sourceCodeStart":53,"sourceCodeEnd":89,"githubUrl":"https://github.com/Unity-Technologies/UnityCsReference/blob/225b0fbdb57cc17d094e8056b71f8314aba56f73/Editor/Mono/Audio/StreamedAudioClipPreview.cs#L53-L89","documentation":"ArgumentException thrown when AudioClipMinMaxOverview.GetOverviewFor(clip) returns null after the null-check on clip passes. This means the overview generation system could not produce a min/max amplitude overview for the given clip, possibly because the clip has no audio data, failed import, or the overview cache is unavailable.","triggerScenarios":"Constructing ClipPreviewDetails with a clip that passes the null check but for which the overview system cannot generate a preview. Occurs with clips that have no samples, clips still being imported, very short clips, or clips with unsupported formats.","commonSituations":"AudioClips with zero-length audio data, clips in the process of being imported (not yet ready), corrupted audio files that imported with warnings but no usable data, clips with non-standard channel configurations, editor startup before the overview cache is initialized.","solutions":["Check if AudioClipMinMaxOverview.GetOverviewFor returns null before constructing ClipPreviewDetails.","Ensure the AudioClip has been fully imported (check AssetDatabase.IsMainAsset or clip.loadState).","Verify the clip has non-zero length and valid audio data.","Skip preview rendering and show a fallback message or placeholder when overview is unavailable."],"exampleFix":"// before\nvar details = new ClipPreviewDetails(clip, looping, size, start, length);\n// after\nvar overview = AudioClipMinMaxOverview.GetOverviewFor(clip);\nif (overview == null)\n{\n    // clip not ready or has no audio data\n    return;\n}\nvar details = new ClipPreviewDetails(clip, looping, size, start, length);","handlingStrategy":"validation","validationCode":"// Check overview availability before constructing ClipPreviewDetails\nvar overview = AudioClipMinMaxOverview.GetOverviewFor(clip);\nif (overview == null)\n{\n    // Clip not ready or has no audio data; skip preview\n    return;\n}\nvar details = new ClipPreviewDetails(clip, looping, size, localStart, localLength);","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Check GetOverviewFor return value before using the clip in preview rendering.","Ensure clips are fully imported before requesting previews.","Handle the case where clips have zero samples gracefully in the UI.","Implement a retry or deferred-render mechanism for clips still being imported."],"tags":["audio","editor","validation","argument-validation","preview","waveform","audio-import"],"backgroundTag":null,"analyzedSha":"225b0fbdb57cc17d094e8056b71f8314aba56f73","analyzedAt":"2026-08-13T19:07:19.849Z","schemaVersion":2},"datasetVersion":"2026-08-13T19:17:28.613Z"}