Skip to content

[bug] Tauri crashes when using create_window with float number as label #3544

@varholak-peter

Description

@varholak-peter

Describe the bug

When I call AppHandle.create_window() or Window.create_window() with a floating number parsed into a String as the label the app crashes.

Reproduction

window.create_window(
    // Ouch here!
    String::from("1.0"),
    tauri::WindowUrl::External(url),
    |win, webview| {
        let win = win
            .title(String::from("Whatever"))
            .resizable(true)
            .inner_size(750.0, 500.0)
            .min_inner_size(400.0, 200.0);
        return (win, webview);
    },
)

Expected behavior

Either accept strings like "1.0" as valid label identifiers or if that's impossible return a Result with an error that specifies that we provided an unsupported label.

Platform and versions

Operating System - Mac OS, version 12.2.1 X64

Node.js environment
  Node.js - 16.13.2
  @tauri-apps/cli - 1.0.0-rc.4 (outdated, latest: 1.0.0-rc.5)
  @tauri-apps/api - 1.0.0-rc.1

Global packages
  npm - 8.1.2
  pnpm - 6.26.1
  yarn - 1.22.0

Rust environment
  rustup - 1.24.3
  rustc - 1.58.1
  cargo - 1.58.0
  toolchain - stable-x86_64-apple-darwin 

App directory structure
/node_modules
/static
/scripts
/src-tauri
/.svelte-kit
/build
/.git
/src

App
  tauri - 1.0.0-rc.3
  tauri-build - 1.0.0-beta.4
  tao - 0.6.2
  wry - 0.13.2
  build-type - bundle
  CSP - unset
  distDir - ../build
  devPath - http://localhost:7024/
  framework - Svelte

Stack trace

No response

Additional context

  • I am executing this inside a #[tauri::command]. I don't think that's relevant, but mentioning just in case.
  • Using an integer such as String::new("5555") works as expected.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions