
4 Cal.2d 499 (1935)
N. HAMAKAWA, Respondent,
v.
CRESCENT WHARF & WAREHOUSE COMPANY (a Corporation), Appellant.
L. A. No. 15322. 
Supreme Court of California. In Bank.  
October 24, 1935.
 George H. Moore for Appellant.
 J. Marion Wright for Respondent.
 SHENK, J.
 The plaintiff sued the defendant for damages for personal injuries sustained while he was about to board the "Norfolk Maru", a freighter docked at a municipal pier in Los Angeles harbor. The jury awarded damages to the plaintiff. The defendant moved in the alternative for a new trial and for judgment notwithstanding the verdict, a motion for a directed verdict having been made before the cause was submitted to the jury. The motion for judgment notwithstanding the verdict was denied and the defendant has appealed from the order denying the motion. *501
 [1] If the trial court should have granted the motion for a directed verdict, the defendant was entitled to a judgment non obstante veredicto. (Code Civ. Proc., sec. 629.) The court should have directed a verdict for the defendant if, disregarding conflicting evidence and giving to the plaintiff's evidence all the value to which it is legally entitled, indulging in every legitimate inference which may be drawn from that evidence, the result is a determination that there is no evidence of sufficient substantiality to support a verdict in favor of the plaintiff. (Estate of Flood, 217 Cal. 763, 768 [21 PaCal.2d 579].)
 The plaintiff is a fisherman. A sailor, member of the crew of the "Norfolk Maru" invited him to come on board to inspect some goldfish which could be purchased. The sailor gave the plaintiff a card signed by himself purporting to be a pass to the ship which was docked at berth 230-D at the municipal pier. The plaintiff with two fishermen friends arrived at the pier in an automobile. A sign on the warehouse at the pier announced that parking of automobiles on municipal piers was absolutely prohibited. The plaintiff and his friends parked the car outside and walked along the pier outside the warehouse past berth 230-E toward the gangplank of the "Norfolk Maru" at berth 230-D. The defendant was a stevedoring concern and with the permission of the General Steamship Corporation, which had control of the dock, and of the shipowners, was engaged in loading cargo from a balcony of the warehouse above where the plaintiff and his friends were walking, into the hold of the "Norfolk Maru". When the plaintiff was within the area occupied by the defendant, an empty sling which was returning from the ship to the balcony struck a bale of paper on the balcony and caused the bale to fall on the plaintiff, causing him the injuries for which he sought redress.
 [2] If the facts disclose only that the plaintiff was on the premises then occupied by the defendant without its consent, express or implied, the defendant owed the plaintiff no legal duty except to refrain from inflicting upon him any wilful or wanton injury (Means v. Southern California Ry. Co., 144 Cal. 473 [77 P. 1001, 1 Ann. Cas. 206]; Powers v. Raymond, 197 Cal. 126, 131 [239 P. 1069]), and to conduct its activities with reasonable care for his safety only after it knew or from facts within its knowledge should have known of the *502 plaintiff's presence. (2 A. L. I. Restatement of the Law of Torts, sec. 346; Lucas v. Walker, 22 Cal.App. 296 [134 P. 374]; Pomponio v. New York, N. H. & H. R. Co., 66 Conn. 528 [34 Atl. 491, 50 Am.St.Rep. 124, 32 L.R.A. 530]; Sage's Admr. v. Creech Coal Co., 194 Ky. 415 [240 S.W. 42].)
 That the defendant gave no express consent to the plaintiff's presence in the place where he was at the time of his injury is conceded, and that the plaintiff was there for a private purpose having no connection with either the business of the defendant or the ship is not disputed. There was therefore no implied consent to the plaintiff's presence within the area occupied by the defendant. The question then is resolved by the state of the record on the inquiry, having in mind the governing rule hereinabove stated, whether the defendant knew or from facts within its knowledge should have known of the plaintiff's presence, or should reasonably have expected him to be where he was. As to the evidence in the record tending to prove that it did not know nor become aware of the plaintiff's presence in fact, there is no conflict.
 [3] The existence of any duty owing by the defendant to refrain from committing negligent acts calculated to cause injury to the plaintiff presupposes that the plaintiff was rightfully where he was at the time (Lucas v. Walker, supra; Herold v. P. H. Mathews Paint House, 39 Cal.App. 489 [179 P. 414]; Sage's Admr. v. Creech Coal Co., supra; Sughrue v. Booth, 231 Mass. 538 [121 N.E. 432]), and that his right to be there was at least equal to the right of the defendant licensee to occupy the premises. (Cameron v. Vandegriff, 53 Ark. 381 [13 S.W. 1092]; Commonwealth Elec. Co. v. Melville, 210 Ill. 70 [70 N.E. 1052].)
 [4] The uncontradicted evidence is that the General Steamship Company had general control of the dock and that all visitors to the "Norfolk Maru" were required to obtain a permit from the office of that company, which was in the pier warehouse, before boarding the ship. The plaintiff testified that he knew that he should obtain permission from that office to go on board. He did not apply at the office nor obtain that permission. It was undisputed that visitors upon applying to the office, were conducted over a safe passageway through the warehouse to the ship, and that such passageway did not traverse the portion of the premises occupied by the defendant. The conclusion from these facts is inescapable *503 that the plaintiff had wandered into a portion of the premises where he had no right to be and where the defendant did not know, and had no reason to expect, him to be at the time he was injured. In this state of the factual situation the plaintiff would not be entitled to recover for an act of negligence of the defendant. (Lindholm v. Northwestern Pac. R. R. Co., 79 Cal.App. 34 [248 P. 1033].) As declared in such cases as Kennedy v. Chase, 119 Cal. 637 [52 P. 33, 63 Am.St.Rep. 153], Medcraft v. Merchants Exchange, 211 Cal. 404, 407 [295 P. 822], and Bush v. Weed Lumber Co., 63 Cal.App. 426, 433 [218 P. 618], the plaintiff might be an invitee or a licensee as to a portion of certain premises, and a trespasser upon another portion thereof. The facts in the present case do not admit of any different conclusion than that the plaintiff was a trespasser upon the portion of the premises occupied by the defendant, and upon which he was at the time the injury occurred, and the trial court, upon such showing, should have directed a verdict for the defendant.
 [5] The plaintiff urges that only the owner of the property may invoke the rule limiting liability as to trespassers. He cites 45 C.J., page 786, section 191; Fitzpatrick v. Penfield, 267 Pa. 564 [109 Atl. 653], and other decisions in support of the rule that the defense of no liability for injury to a trespasser is personal to the owner of the premises trespassed upon and does not inure to the benefit of strangers to the title, adjoining owners or other trespassers. The principle invoked by the plaintiff is well supported by authority but it is not applicable to the facts presented here. In none of the cases referred to, with the exception of the case of Guinn v. Delaware & A. Tel. Co., 72 N. J. L. 276 [62 Atl. 412, 111 Am.St.Rep. 668], which is shown by a note in 3 L.R.A. (N. S.) 988 to be opposed to the weight of authority, did it appear that the defendant as against the plaintiff had any greater or exclusive right to the premises, and in none of them was the plaintiff shown to have been a trespasser as against the person charged with liability. In the final analysis, as recognized by those same authorities, the test is whether the defendant engaged in the commission of the negligent act knew of or had reason to expect the presence of the person injured within the range of his negligent activities. In 45 C.J., page 786, it is also stated: "But ownership of the property trespassed upon is not an absolute test, for the rule of nonliability may be successfully *504 invoked by one who, although not the owner of the property on which the injury occurred, had rights therein superior to those of the trespasser who was injured ..." The invocation of the rule of nonliability may be made by the owner or the person who has the right of control of the premises. (45 C.J., p. 787, and cases cited.) That the defendant stood in that relation to the plaintiff under the facts here cannot be questioned.
 The order denying the defendant's motion for judgment notwithstanding the verdict is reversed.
 Thompson, J., Seawell, J., Curtis, J., Langdon, J., and Waste, C.J., concurred.
