diff options
Diffstat (limited to 'src/fltk-widgets-groups-browsers-textline.adb')
-rw-r--r-- | src/fltk-widgets-groups-browsers-textline.adb | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/fltk-widgets-groups-browsers-textline.adb b/src/fltk-widgets-groups-browsers-textline.adb index de3f339..7c8dc3b 100644 --- a/src/fltk-widgets-groups-browsers-textline.adb +++ b/src/fltk-widgets-groups-browsers-textline.adb @@ -682,10 +682,16 @@ package body FLTK.Widgets.Groups.Browsers.Textline is (This : in out Textline_Browser; File : in String) is + Msg : Interfaces.C.Strings.chars_ptr; Code : Interfaces.C.int := fl_browser_load (This.Void_Ptr, Interfaces.C.To_C (File)); begin if Code = 0 then - raise Browser_Load_Error with Interfaces.C.Strings.Value (get_error_message); + Msg := get_error_message; + if Msg = Interfaces.C.Strings.Null_Ptr then + raise Browser_Load_Error; + else + raise Browser_Load_Error with Interfaces.C.Strings.Value (Msg); + end if; elsif Code /= 1 then raise Internal_FLTK_Error; end if; |