assuming you'll reach them
If you learn one without the other it's the same problem right? You'll consistently reach endgames then blunder half points all the time, so it's better to be well rounded.
In any case, you can't be a good middlegame player if you don't know much about the endgame. You'll have to go for desperate attacks (of one sort or another) in equal positions all the time.
Learn endgames. Most players forget to learn them, so if you know them it would give you a big advantage.