From c58c03167dfb29b50ed9c07c94259fdc1730ef4b Mon Sep 17 00:00:00 2001 From: Tony Kostanjsek <708330+lobotony@users.noreply.github.com> Date: Wed, 23 Oct 2019 22:40:07 +0200 Subject: [PATCH] vlib/darwin: remove assert --- vlib/darwin/darwin.v | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/vlib/darwin/darwin.v b/vlib/darwin/darwin.v index 3887b45260..1ca5ee8a3a 100644 --- a/vlib/darwin/darwin.v +++ b/vlib/darwin/darwin.v @@ -26,12 +26,16 @@ pub fn resource_path() string { main_bundle := C.CFBundleGetMainBundle() resource_dir_url := C.CFBundleCopyResourcesDirectoryURL(main_bundle) - assert !isnil(resource_dir_url) + if (isnil(resource_dir_url)) { + panic('CFBundleCopyResourcesDirectoryURL failed') + } buffer_size := 4096 mut buffer := malloc(buffer_size) buffer[0] = 0 conv_result := C.CFURLGetFileSystemRepresentation(resource_dir_url, true, buffer, buffer_size) - assert conv_result + if(conv_result == 0) { + panic('CFURLGetFileSystemRepresentation failed') + } result := string(buffer) C.CFRelease(resource_dir_url) return result