Would it be unjust for God to send someone to hell who did not have the law or accepted Jesus as Lord and Savior?
"I am the way and the truth and the life. No one comes to the Father except through me” (John 14:6). The law was giving to Moses for Hebrew Israelites not the Gentiles, but surely not everyone has heard the name of Jesus or what he has done for them. What about the people that lived before Abraham. The flood of Noah days destroyed all of human life except eight souls. After Abraham death to when Moses was born was about 250 years later.
In Genesis 15:13 Abraham’s descendants was enslaved. The Lord said to him, "Know for certain that your descendants will be strangers in a country not their own, and they will be enslaved and mistreated four hundred years. So, did all these people die and go to hell? Does the Bible give us any information about what some of these people may had to face as judgement for their life activity to God? From Adam to Abraham, to Moses receiving the law altogether was about 2150 years. They were not saved and could not be saved because Jesus had not come to give his life for them. God does not love some people more than others.
Romans 2:9-16 explains that every one who does what is wrong will have much trouble and a hard times. All those who do not know the law given to Moses and did what was wrong will die, but they will not be judged by the law. All those who know the law and did what was wrong will be judged by the law. God does not say people are good because they have heard the law, but people who obey the law. Some people do not have the law but they do what the law says because their own hearts tell them to. They have a law of their own, even though they do not know the law, they show that the law is written in their hearts. They know what is right to do and what is wrong to do, their own thoughts or consciences tell them they have done what is wrong or what is right.
Now that's true love for God in his infinite wisdom to have a backup plan to cover all mankind long before Jesus became our savior. God knew that every person would not hear or have heard his inspired word giving by the prophets. God gave man a free will to do or not do and with this he can now judge them fairly, that does not apply to people that have heard or refuse to hear, however, some people will try to replace the Word of God for some self inspiring intellectual speeches but the word tells us that “there is a way which seems right to a man and appears straight before him, but at the end of it is the way of death” (Proverbs 14:12, Amplified Bible).
For us that have heard the Word of God, Jesus said "I am the way and the truth and the life (John 14:6), not the preacher, teacher, church or religious organization. God has given us the Holy Spirit to lead and guide us into all truth (John 16:13).