It's entirely random, as well. First run of the game, it happened a few seconds after the mushroom enemies spawned in the forest, second run I made it a minute or two longer, third time it crashed before the mushrooms. Guess it depends on level speed and how many items you have? Since the more items you have the less likely it is to hit one that maxed out. Do you have a check in the level up code to check for the level of an item and swap the option if it's already maxed?
Like an if() where it checks the max level and if it is maxed, it changes choice X to be a different power up, or, if you have no slots left, removes the choice completely. Thinking about it, it could be the code attempting to give another passive/weapon when you're full up on them.
Could also be that it's the removal of the choice that's the issue, if you do have this sort of code, because it's saying an empty text variable, "", is the issue. Maybe the variable used isn't a text variable, and the "" is breaking it? Maybe you're somehow trying to put a text variable into a numerical variable? No idea, just tossing out ideas.
All I know for sure is that the error told me it was on line 1305. Good luck fixing it.
Also, might want to add a feature that either forces a weapon on the player, gives them a default punch, or a way for enemies to despawn and get replaced by new ones, because I made the stupid decision to get a passive as my first item, forgetting for a moment you have no passive way to deal damage to start with, so I can't kill anything to level up, and no new mobs can spawn. Because of that, I managed to kite them around and now they're all stacked on each other. Kinda funny, but not really good gameplay. xP