Robert's claim to the throne was rather tenuous and did not follow primogeniture. Andrew's grandfather, Charles Martel of Anjou, had died young; therefore, the throne should have passed to Andrew's father. However, due to fears of impending invasion from Sicily, it was felt that a seven-year-old heir was too risky and would not be able to hold off invasions. The throne was offered to the next son of Charles II of Naples, Louis, but he refused on religious grounds, and it thus passed to Robert. To recompensate Andrew's father, Charles II decided to assign him the claim to Hungary.