Modify

#2170 closed Bug (Fixed)

_ArrayDisplay fails handling arrays with no elements

Reported by: ripdad Owned by: guinness
Milestone: 3.3.9.3 Component: Standard UDFs
Version: 3.3.8.1 Severity: None
Keywords: Cc:

Description

When trying to view with _ArrayDisplay, array.au3 crashes at:
Line #(depending on version) --> Local $avArrayText[$iUBound + 1]

#include <array.au3>

_Test()

Func _Test()
    Local $objWMI = ObjGet('Winmgmts:\\.\root\CIMV2')
    Local $objClass = $objWMI.Get('__NotifyStatus')
    Local $Value
    ;
    For $objItem in $objClass.SystemProperties_()
        $Value = $objItem.Value

        If IsArray($Value) Then

            MsgBox(0, '', 'Elements: ' & UBound($Value) & @CRLF & 'Subscripts: ' & UBound($Value, 0))

            _ArrayDisplay($Value)

        EndIf

    Next
EndFunc

Link: http://www.autoitscript.com/forum/topic/139097-arraydisplay-and-arrays-with-no-elements/

Attachments (0)

Change History (4)

comment:1 by trancexx, on Apr 1, 2012 at 1:07:01 PM

That variable is array, so IsArray() is fine.
_ArrayDisplay() needs to check for situations like this.

comment:2 by trancexx, on Apr 1, 2012 at 7:43:05 PM

Component: AutoItStandard UDFs
Summary: IsArray detects arrays with no elements_ArrayDisplay fails handling arrays with no elements

comment:3 by guinness, on Apr 2, 2012 at 4:24:48 PM

Milestone: 3.3.9.3
Owner: set to guinness
Resolution: Fixed
Status: newclosed

Fixed by revision [6887] in version: 3.3.9.3

comment:4 by anonymous, on May 10, 2021 at 4:56:24 AM

WGJW9 - MQBRH - C3VXP - DB6PF - M89P3

Modify Ticket

Action
as closed The owner will remain guinness.

Add Comment


E-mail address and name can be saved in the Preferences .
 
Note: See TracTickets for help on using tickets.