That's not a bad thing at all. Were you by any chance playing along with a backing track? I would guess you were. If not, don't sweat it. I do it all the time. If I'm playing guitar especially, I'm humming bass parts and drum grooves while I work stuff out. If I'm doing session work, I take the sheet music and hum through it a few times before tracking. If I'm playing along with a bass player and the guitarist is doing some weird over-the-bar phrasing or something, I'll often try to hum what he's doing in relation to us, then once I've got it, I'll jump out the pattern I';m playing sporadically and mimic what the guitar is doing then jump back. You're Melodies have to come from somewhere man, unless Dude... you're Mike Portonoy and don't believe in them
Don't sweat it.... If you're humming melody, you're even
ahead of the game.