From b0ddab5e24e62ec21a3a8fcd74cb34791441d6f1 Mon Sep 17 00:00:00 2001 From: Javier Sancho Date: Sat, 23 May 2020 20:27:09 +0200 Subject: [PATCH] check video driver creation --- irrlicht/device.scm | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/irrlicht/device.scm b/irrlicht/device.scm index e5eac5a..2035932 100644 --- a/irrlicht/device.scm +++ b/irrlicht/device.scm @@ -45,10 +45,9 @@ (let* ((createDevice (get-irrlicht-proc "createDevice")) (device (createDevice device-type window-size bits fullscreen stencilbuffer vsync receiver))) - (cond ((null-object? device) - (error "In procedure create-device: Device cannot be created")) - (else - device)))) + (if (null-object? device) + (error "In procedure create-device: Device cannot be created") + device))) (define-method (get-cursor-control (device )) (let ((getCursorControl (get-irrlicht-proc "getCursorControl" device))) @@ -71,8 +70,11 @@ (getTimer device))) (define-method (get-video-driver (device )) - (let ((getVideoDriver (get-irrlicht-proc "getVideoDriver" device))) - (getVideoDriver device))) + (let* ((getVideoDriver (get-irrlicht-proc "getVideoDriver" device)) + (driver (getVideoDriver device))) + (if (null-object? driver) + (error "In procedure get-video-driver: Driver cannot be created") + driver))) (define-method (is-window-active? (device )) (let ((isWindowActive (get-irrlicht-proc "isWindowActive" device))) -- 2.39.5