Operator ‘==‘ cannot be applied to ‘int‘, ‘null‘

简介: Operator ‘==‘ cannot be applied to ‘int‘, ‘null‘

今天写代码的时候遇到了一个bug:

如何解决:

if(quicklink.getId() ==null)

修改好

Integer id = quicklink.getId();
if(id==null || id == 0){
}

就好了


相关文章
|
12月前
【已解决】TypeError: Cannot destructure property `createHash` of ‘undefined‘ or ‘null‘
【已解决】TypeError: Cannot destructure property `createHash` of ‘undefined‘ or ‘null‘
300 1
|
1月前
解决微软云Azure Function运行报错-Value cannot be null. (Parameter ‘provider‘)
解决微软云Azure Function运行报错-Value cannot be null. (Parameter ‘provider‘)
43 4
|
1月前
|
JavaScript 前端开发
15 Uncaught TypeError: Cannot set properties of null (setting ‘onclick‘)
这篇文章解释了在HTML文档中因JavaScript代码在页面元素加载之前执行导致的"Cannot set properties of null (setting ‘onclick’)"错误,并提供了将JavaScript代码置于`<body>`标签内或使用`window.onload`事件确保DOM完全加载后再绑定事件处理器的解决办法。
15 Uncaught TypeError: Cannot set properties of null (setting ‘onclick‘)
|
24天前
|
C++ Python
【Azure 应用服务】Azure Function Python函数部署到Azure后遇见 Value cannot be null. (Parameter 'receiverConnectionString') 错误
【Azure 应用服务】Azure Function Python函数部署到Azure后遇见 Value cannot be null. (Parameter 'receiverConnectionString') 错误
|
24天前
|
JavaScript 前端开发 C++
【Azure Function】调试 VS Code Javascript Function本地不能运行,报错 Value cannot be null. (Parameter 'provider')问题
【Azure Function】调试 VS Code Javascript Function本地不能运行,报错 Value cannot be null. (Parameter 'provider')问题
|
2月前
|
存储
Cannot read properties of null (reading ‘msg‘)
Cannot read properties of null (reading ‘msg‘)
|
11月前
|
JavaScript API
【Vue】Cannot set reactive property on undefined,null,or primitive value:undefined
【Vue】Cannot set reactive property on undefined,null,or primitive value:undefined
195 0
|
10月前
|
JavaScript
TypeError: Cannot read properties of null (reading &#39;level&#39;)
# 一、分析问题 1、一个下拉框组件的更新由另一个下拉框组件控制被动更新列表,子级下拉框的值是由父级下拉框的值调用接口获取,每次父级下拉框值的改变都会改变子级下拉框的数据源也就是会改变子级下拉框的options,切换后之前的父级节点找不到就会报了这个错,父级节点不改变(即不切换)的话不会报错 # 二、解决方案 ## 1、vue页面的html层 ```html &lt;div&gt; &lt;el-row :gutter=&quot;15&quot;&gt; &lt;el-col :span=&quot;4&quot;&gt; &lt;div&quot;&gt;父级下拉框:&lt;/div&gt; &lt;el-select clearable v-model=&quot;parentId&quot; @c
141 0
|
11月前
|
缓存 Cloud Native JavaScript
猫头虎的技术博客:解决npm报错 npm ERR! Cannot read properties of null (reading ‘pickAlgorithm‘)报错问题
猫头虎的技术博客:解决npm报错 npm ERR! Cannot read properties of null (reading ‘pickAlgorithm‘)报错问题
165 0
解决npm ERR! Cannot read properties of null (reading ‘pickAlgorithm‘)报错问题
在vue项目中,使用npm i 命令安装node modules时,出现报错。