Skip to content

Commit 887a044

Browse files
Fix null dereference on error in iOS CameraDevice (#1649)
The \�rror\ variable passed to \ ewRenderPipelineStateWithDescriptor\ may be nil even when the call fails. This guards against dereferencing nil when building the error message string. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent 1f57a2e commit 887a044

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

Plugins/NativeCamera/Source/Apple/CameraDevice.mm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -412,7 +412,7 @@ fragment float4 fragmentShader(RasterizerData in [[stage_in]],
412412

413413
if (!m_impl->cameraPipelineState) {
414414
return arcana::task_from_error<CameraDimensions>(std::make_exception_ptr(std::runtime_error{
415-
std::string("Failed to create camera pipeline state: ") + [error.localizedDescription cStringUsingEncoding:NSASCIIStringEncoding]}));
415+
std::string("Failed to create camera pipeline state") + (error ? std::string(": ") + [error.localizedDescription cStringUsingEncoding:NSASCIIStringEncoding] : "")}));
416416
}
417417

418418
m_impl->isInitialized = true;

0 commit comments

Comments
 (0)