I had trouble with this as well so don't worry, you're not alone.
Indirect objects are nouns and pronouns that identify to whom or for whom the action of the verb is performed.
Direct objects are nouns, pronouns, clauses, and phrases.
Answer:
I believe the answer is "My only safety seemed to be in keeping next to the wall"
Explanation:
I hope this helps