Skip to content

panic: runtime error: index out of range [-1] #4

Closed
@dima2306

Description

@dima2306

Hello, the project I wanted to try this tool on is a very old Laravel 5.2

After running ./vendor/bin/hsa check I get the error:

Config file used successfully                                                                                                                                                                                                                                                                                        ─╯
panic: runtime error: index out of range [-1]

goroutine 1 [running]:
github.com/MaestroError/html-strings-affixer/parsehtml.(*Parsehtml).removeParseSuffix(0xc000109e68, {0x0, 0x0})
        /home/maestroerror/Desktop/html-strings-affixer/parsehtml/parsehtml.go:361 +0x92
github.com/MaestroError/html-strings-affixer/parsehtml.(*Parsehtml).parseContent(0xc000109e68, {0x533912, 0x4})
        /home/maestroerror/Desktop/html-strings-affixer/parsehtml/parsehtml.go:323 +0xd8
github.com/MaestroError/html-strings-affixer/parsehtml.(*Parsehtml).ExtractTextCC(0xc000109e68)
        /home/maestroerror/Desktop/html-strings-affixer/parsehtml/parsehtml.go:151 +0x8b
github.com/MaestroError/html-strings-affixer/parsehtml.(*Parsehtml).ParseFile(0xc000109e68, {0xc000114090?, _}, {{0xc0000be3d0, 0xf}, {0xc0000b8140, 0x1, 0x4}, {0x654630, 0x0, ...}, ...})
        /home/maestroerror/Desktop/html-strings-affixer/parsehtml/parsehtml.go:51 +0xb4
github.com/MaestroError/html-strings-affixer/app.runCheckCommand()
        /home/maestroerror/Desktop/html-strings-affixer/app/app.go:236 +0x145
github.com/MaestroError/html-strings-affixer/app.Start()
        /home/maestroerror/Desktop/html-strings-affixer/app/app.go:64 +0x69
main.main()
        /home/maestroerror/Desktop/html-strings-affixer/main.go:19 +0x25

Can this error occur if some blade files can have corrupted HTML structure or HTML fragments? I mean some files are "partial" and imported.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions