             "sr": screenResolution,
             "v": "1"
         ]
-        if !type.isEmpty {
+        
+        if let type = type, !type.isEmpty {
             queryArguments.updateValue(type, forKey: "t")
         }
         

    /// - Parameter parameters: A dictionary of additional parameters for the event.
    public func screenView(_ name: String, parameters: [String: String] = [:]) {
        let data = parameters.combinedWith(["cd": name])
        send("screenView", parameters: data)
    }

    /// Tracks a session start to Google Analytics.

            "dp": appName,
        ]

        send(type: nil, parameters: queryArguments)
    }

    /// Tracks an event to Google Analytics.
