Hi BaseX team!

I have a database with a text-index for a node named "serial-number" with 2,164,980 occurrences of text '0000000'. [1]

If I execute :

util:item(db:text("US02", "0000000"), 1)

I get '0000000', as expected.

But, If I execute:

  util:item(db:text("US02", "0000000"), 2)  

I get the error message in [2]

The same happens with 

db:text("US02", "0000000")[2]
subsequence(db:text("US02", "0000000"),2,1)

I recorded everything on this video [3]

Is this a bug?, I optimized the database before executing the queries.

Best regards,
Sebastian.


[1] https://imgur.com/UDgXYPY

[2] Stack Trace: 
java.lang.NullPointerException
at org.basex.query.expr.ParseExpr.iter(ParseExpr.java:46)
at org.basex.query.scope.MainModule.iter(MainModule.java:97)
at org.basex.query.QueryContext.iter(QueryContext.java:333)
at org.basex.query.QueryContext.cache(QueryContext.java:630)
at org.basex.query.QueryProcessor.cache(QueryProcessor.java:113)
at org.basex.core.cmd.AQuery.query(AQuery.java:101)
at org.basex.core.cmd.XQuery.run(XQuery.java:22)
at org.basex.core.Command.run(Command.java:257)
at org.basex.core.Command.execute(Command.java:93)
at org.basex.gui.GUI.exec(GUI.java:416)
at org.basex.gui.GUI.lambda$4(GUI.java:359)
at java.lang.Thread.run(Unknown Source) 

[3] https://youtu.be/gXYpBNd7iJc